Skip to content

Commit

Permalink
Fix locality issue for HALO option in the teleport module (#328)
Browse files Browse the repository at this point in the history
* Broadcast chute function and exec on local machine

* Code optimization
  • Loading branch information
Kexanone authored and CreepPork committed Jun 22, 2018
1 parent f827cd6 commit 0e1d0bd
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ private _doHALO = (_additionalOption == 2);

if (_doHALO) then
{
// broadcast chute functions for HALO
if (isNil "Achilles_var_eject_init_done") then
{
publicVariable "Achilles_fnc_chute";
publicVariableServer "Achilles_fnc_eject_passengers";
Achilles_var_eject_init_done = true;
};
// set the altitude
_teleportLocation set [2, 3000];
};

Expand All @@ -34,10 +42,16 @@ while {!(_playersToTeleport isEqualto [])} do
{
sleep 1;
};

_unit setVehiclePosition [_teleportLocation, [], 0, "FORM"];
_unit setPos [getPos _unit select 0, getPos _unit select 1, _teleportLocation select 2];
if (_doHALO) then {[_unit] call Achilles_fnc_chute};

if (_doHALO) then
{
_unit setPos _teleportLocation;
[_unit] remoteExec ["Achilles_fnc_chute", _unit]
}
else
{
_unit setVehiclePosition [_teleportLocation, [], 0, "FORM"];
};
};

_playersToTeleport = [_playersToTeleport - [_unit_to_tp], _playersToTeleport - crew _unit_to_tp] select _includeVehicles;
Expand Down

0 comments on commit 0e1d0bd

Please sign in to comment.