manual merge

This commit is contained in:
commy2 2015-04-26 21:26:57 +02:00
commit aabe532829
3 changed files with 63 additions and 63 deletions

View File

@ -1,19 +1,19 @@
/*
Name: ACE_Respawn_fnc_module
Name: ACE_Respawn_fnc_module
Author(s):
KoffeinFlummi, bux578, esteldunedain, commy2
Author(s):
KoffeinFlummi, bux578, esteldunedain, commy2
Description:
initializes the respawn module
Description:
initializes the respawn module
Parameters:
0: OBJECT - logic
1: ARRAY<OBJECT> - synced units
2: BOOLEAN - activated
Parameters:
0: OBJECT - logic
1: ARRAY<OBJECT> - synced units
2: BOOLEAN - activated
Returns:
VOID
Returns:
VOID
*/
#include "script_component.hpp"
@ -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

@ -1,47 +1,51 @@
/*
Name: ACE_Respawn_fnc_moveRallypoint
Author(s):
commy2
Description:
Moves a rallypoint to the player's location
Parameters:
0: OBJECT - unit
1: OBJECT - side
Returns:
VOID
Name: ACE_Respawn_fnc_moveRallypoint
Author(s):
commy2
Description:
Moves a rallypoint to the player's location
Parameters:
0: OBJECT - unit
1: OBJECT - side
Returns:
VOID
*/
#include "script_component.hpp"
_this spawn {
PARAMS_2(_unit,_side);
private ["_rallypoint", "_position"];
// rallypoint names are defined in CfgVehicles.hpp
PARAMS_2(_unit,_side);
_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;
private ["_rallypoint", "_position"];
if (isNull _rallypoint) exitWith {};
// rallypoint names are defined in CfgVehicles.hpp
_position = getPosATL _unit;
_position = _position findEmptyPosition [0, 2, typeOf _rallypoint];
if (count _position == 0) then {_position = getPosATL _unit};
_rallypoint = [
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
] select ([west, east, independent] find _side) + 1;
_position set [2, 0];
if (isNull _rallypoint) exitWith {};
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(common,displayTextStructured);
_position = getPosATL _unit;
_position = _position findEmptyPosition [0, 2, typeOf _rallypoint];
if (count _position == 0) then {_position = getPosATL _unit};
_position set [2, 0];
[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

@ -1,22 +1,22 @@
/*
Name: ACE_Respawn_fnc_removeBody
Author(s):
bux578
Description:
removes a given body
Parameters:
0: OBJECT - body
1: BOOLEAN - forceRemove // not used atm
Returns:
VOID
*/
#include "script_component.hpp"
private ["_body", "_forceRemove", "_bodyRemoveTimer"];
_body = _this select 0;
@ -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);