This commit is contained in:
ulteq 2015-04-26 21:28:27 +02:00
commit 3aa759f914
3 changed files with 63 additions and 63 deletions

View File

@ -31,21 +31,17 @@ GVAR(Module) = true;
if (isServer) then {
if (GVAR(RemoveDeadBodiesDisconnected)) then {
private "_fnc_deleteDisconnected";
_fnc_deleteDisconnected = {
_this spawn {
addMissionEventHandler ["HandleDisconnect", {
[{
PARAMS_1(_unit);
sleep 4;
if (!alive _unit) then {
deleteVehicle _unit;
};
};
},
_this, 4, 1] call EFUNC(common,waitAndExecute);
false
};
addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected];
}];
};
};

View File

@ -17,31 +17,35 @@
#include "script_component.hpp"
_this spawn {
PARAMS_2(_unit,_side);
PARAMS_2(_unit,_side);
private ["_rallypoint", "_position"];
private ["_rallypoint", "_position"];
// rallypoint names are defined in CfgVehicles.hpp
// rallypoint names are defined in CfgVehicles.hpp
_rallypoint = [
_rallypoint = [
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] select ([west, east, independent] find _side) + 1;
missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
] select ([west, east, independent] find _side) + 1;
if (isNull _rallypoint) exitWith {};
if (isNull _rallypoint) exitWith {};
_position = getPosATL _unit;
_position = _position findEmptyPosition [0, 2, typeOf _rallypoint];
if (count _position == 0) then {_position = getPosATL _unit};
_position = getPosATL _unit;
_position = _position findEmptyPosition [0, 2, typeOf _rallypoint];
if (count _position == 0) then {_position = getPosATL _unit};
_position set [2, 0];
_position set [2, 0];
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(common,displayTextStructured);
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(common,displayTextStructured);
[{
_rallypoint = _this select 0;
_unit = _this select 1;
_position = _this select 2;
_rallypoint = _this select 3;
sleep 5;
_rallypoint setPosATL _position;
_unit reveal _rallypoint;
@ -50,4 +54,5 @@ _this spawn {
["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent);
[localize "STR_ACE_Respawn_Deployed"] call EFUNC(common,displayTextStructured);
};
},
[_rallypoint, _unit, _position, _rallypoint], 5, 1] call EFUNC(common,waitAndExecute);

View File

@ -29,9 +29,8 @@ if (_forceRemove) then {
_bodyRemoveTimer = 2;
};
[_body, _bodyRemoveTimer] spawn {
sleep (_this select 1);
[{
// hideBody takes ~20s till body is fully underground
// a better hideBody would make this more aesthetic
deleteVehicle (_this select 0);
};
deleteVehicle _this;
}, _body, _bodyRemoveTimer, 1] call EFUNC(common,waitAndExecute);