From 26166becb07f7e4adcfc0a6ad804572c21e237f4 Mon Sep 17 00:00:00 2001 From: nomisum Date: Sat, 23 Jan 2016 18:50:09 +0100 Subject: [PATCH] fog tweaks, spawn tweaks --- helpers/spawnBluforHQ.sqf | 7 ++++--- init.sqf | 17 +++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/helpers/spawnBluforHQ.sqf b/helpers/spawnBluforHQ.sqf index 19a8d579..bad5103e 100644 --- a/helpers/spawnBluforHQ.sqf +++ b/helpers/spawnBluforHQ.sqf @@ -1,4 +1,6 @@ checkInsideMap = { + // 0 = mapsize + // 1 = spawnpos _maximumX = _this select 0; _maximumY = _this select 0; _positionX = (_this select 1) select 0; @@ -103,9 +105,8 @@ testSpawnPositions = { if (count _testPos1 < 1) exitWith {_result = [1,nil,nil];}; // if map size is known and spawn position is outside map, result is 1 - if (_mapSizeKnown) then { - if (!([_mapSize, _testPos1] call checkInsideMap)) exitWith {_result = [1,nil,nil]; diag_log format ["Calculating Spawnpos: Outside Map."]; _result }; - }; + if (!([_mapSize, _testPos1] call checkInsideMap) && _mapSizeKnown) exitWith {_result = [1,nil,nil]; diag_log format ["Calculating Spawnpos: Outside Map."]; _result }; + if ([_testPos1, 5] call get_slope > 0.5) exitWith {_result = [1,nil,nil]; diag_log format ["Calculating Spawnpos: Not flat enough."]; _result }; diff --git a/init.sqf b/init.sqf index e4616cff..d06588aa 100644 --- a/init.sqf +++ b/init.sqf @@ -38,18 +38,19 @@ disableRemoteSensors true; setCustomWeather = { // skipTime -24; - 10 setOvercast (_this select 0); - if (_this select 1) then { - 10 setRain 1; - _fogDensity = random 1; - _fogFalloff = random 0.1; - 10 setFog [_fogDensity, _fogFalloff, 0]; - }; + 10 setOvercast (_this select 0); if ((_this select 0) > 0.5) then { _fogDensity = random 0.2; _fogFalloff = random 0.01; 10 setFog [_fogDensity, _fogFalloff, 0]; + }; + if (_this select 1 && (_this select 0) > 0.7) then { + 10 setRain 1; + _fogDensity = random 1; + _fogFalloff = random 0.05; + 10 setFog [_fogDensity, _fogFalloff, 0]; }; + setViewDistance 6000; forceWeatherChange; // skipTime 24; @@ -72,7 +73,7 @@ if (isServer) then { switch (WEATHER_SETTING) do { case 0: {[0,false] call setCustomWeather;}; - case 1: {[0.6,false] call setCustomWeather;}; + case 1: {[0.69,false] call setCustomWeather;}; case 2: {[1,true] call setCustomWeather;}; case 3: {[random 1,true] call setCustomWeather;}; default {[0,false] call setCustomWeather;};