Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather - Fix wind on airports #6631

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions addons/weather/functions/fnc_calculateRoughnessLength.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
#define ROUGHNESS_LENGTHS [0.0002, 0.0005, 0.0024, 0.03, 0.055, 0.1, 0.2, 0.4, 0.8, 1.6]

private _windSource = _this vectorDiff ((vectorNormalized wind) vectorMultiply 25);

private _nearBuildings = count (_windSource nearObjects ["Building", 50]);
private _nearBuildings = {
// Filter lights - fixes high roughness on airports (#6602)
str _x find "light" == -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is case sensitive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know.

Copy link
Contributor

@dedmen dedmen Oct 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of CUP runway lights are lowercase. With exception of CUP_A1_NavigLight but it's modelname is naviglight.p3d and I think str object returns modelname right?
Vanilla Arma "Runway Edgelight" is Land_Flush_Light_green_F uppercase Light.
Land_NavigLight/\A3\Roads_F\Runway\RunwayLights\NavigLight.p3d is also a runway light ("REIL")
Land_PortableHelipadLight_01_F/PortableHelipadLight_01_F.p3d

Land_runway_edgelight there are 7 variants for this and they are all lowercase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flush light is also lowercase. All lights I've seen are lowercase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ 
    (boundingBox _x) params ["_a", "_b"];
    (_a distance2D _b) > 5
} count (player nearObjects ["Building", 50]);

Could also check size (2d, because a lot of lights are actually very long poles)
(0.06ms vs 0.038ms for 15 objects)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a neat idea, though I would say a much lower number than 5. Bushes and such should affect roughness.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"light" is faster and should probably work for most objects we want to filter
we can always look at size checking later

} count (_windSource nearObjects ["Building", 50]);
private _isWater = surfaceIsWater _windSource;

if (_nearBuildings == 0 && _isWater) exitWith {
Expand Down