diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf index 8a0a154..015c08c 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf @@ -13,37 +13,29 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; - private ["_start","_bbr","_p1","_p2","_maxHeight","_signalCrate","_smokeShell","_light","_lightSource"]; - params["_crate",["_time",60]]; - _start = diag_tickTime; - //diag_log format["signalEnd.sqf: _this = %1, _crate = %2",_this, _crate]; - _smokeShell = selectRandom ["SmokeShellOrange","SmokeShellBlue","SmokeShellPurple","SmokeShellRed","SmokeShellGreen","SmokeShellYellow"]; - _lightSource = selectRandom ["Chemlight_green","Chemlight_red","Chemlight_yellow","Chemlight_blue"]; - //diag_log format["signalEnd.sqf: _smokeShell = %1",_smokeShell]; - // Determine crate height. Method is from: - // https://community.bistudio.com/wiki/boundingBoxReal - _bbr = boundingBoxReal _crate; - _p1 = _bbr select 0; - _p2 = _bbr select 1; - _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); - - while {diag_tickTime - _start < (_time)} do // loop for 5 min accounting for the fact that smoke grenades do not last very long +private ["_start","_maxHeight","_smokeShell","_light","_lightSource"]; +params["_crate",["_time",60]]; +_start = diag_tickTime; +//diag_log format["signalEnd.sqf: _this = %1, _crate = %2",_this, _crate]; +_smokeShell = selectRandom ["SmokeShellOrange","SmokeShellBlue","SmokeShellPurple","SmokeShellRed","SmokeShellGreen","SmokeShellYellow"]; +_lightSource = selectRandom ["Chemlight_green","Chemlight_red","Chemlight_yellow","Chemlight_blue"]; +while {diag_tickTime - _start < (_time)} do // loop for 5 min accounting for the fact that smoke grenades do not last very long +{ + _smoke = _smokeShell createVehicle getPosATL _crate; + _smoke setPosATL (getPosATL _crate); + _smoke attachTo [_crate,[0,0,(0.5)]]; // put the smoke a fixed distance above the top of any object to make it as visible as possible + if(sunOrMoon < 0.2) then { - _smoke = _smokeShell createVehicle getPosATL _crate; - _smoke setPosATL (getPosATL _crate); - _smoke attachTo [_crate,[0,0,(_maxHeight + 0.35)]]; // put the smoke a fixed distance above the top of any object to make it as visible as possible - if(sunOrMoon < 0.2) then - { - _light = _lightSource createVehicle getPosATL _crate; - _light setPosATL (getPosATL _crate); - _light attachTo [_crate,[0,0,(_maxHeight + 0.35)]]; - }; - uiSleep 120; - detach _smoke; - deleteVehicle _smoke; - if(sunOrMoon < 0.2) then - { - detach _light; - deleteVehicle _light; - }; + _light = _lightSource createVehicle getPosATL _crate; + _light setPosATL (getPosATL _crate); + _light attachTo [_crate,[0,0,(_maxHeight + 0.35)]]; }; + uiSleep 120; + detach _smoke; + deleteVehicle _smoke; + if(sunOrMoon < 0.2) then + { + detach _light; + deleteVehicle _light; + }; +}; \ No newline at end of file