Merge pull request #3752 from Cuel/remove-dead-bodies-fix

Fix "remove dead bodies on disconnect" when enabled and forced
This commit is contained in:
commy2 2016-05-03 22:38:28 +02:00
commit 07977b9a9a
3 changed files with 20 additions and 18 deletions

View File

@ -14,6 +14,7 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
serverInit = QUOTE(call COMPILE_FILE(XEH_serverPostInit));
};
};

View File

@ -0,0 +1,17 @@
#include "script_component.hpp"
["SettingsInitialized", {
if (GVAR(RemoveDeadBodiesDisconnected)) then {
addMissionEventHandler ["HandleDisconnect", {
[{
params ["_unit"];
if (!alive _unit) then {
deleteVehicle _unit;
};
},
_this, 4] call EFUNC(common,waitAndExecute);
false
}];
};
}] call EFUNC(common,addEventHandler);

View File

@ -19,25 +19,9 @@
params ["_logic", "_units", "_activated"];
if !(_activated) exitWith {};
if (!_activated) exitWith {};
GVAR(Module) = true;
[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(RemoveDeadBodiesDisconnected), "RemoveDeadBodiesDisconnected"] call EFUNC(common,readSettingFromModule);
if (isServer && {GVAR(RemoveDeadBodiesDisconnected)}) then {
addMissionEventHandler ["HandleDisconnect", {
[{
params ["_unit"];
if (!alive _unit) then {
deleteVehicle _unit;
};
},
_this, 4] call EFUNC(common,waitAndExecute);
false
}];
};
ACE_LOGINFO("Respawn Module Initialized.");