2016-02-13 23:59:11 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
|
|
|
* Removes corpse. Idealy it is just deleted the next frame,
|
|
|
|
* but player bodies cannot be deleted until they respawn, so it is hidden and deleted later.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Mr Body <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2016-02-13 23:59:11 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [cursorTarget] call ace_medical_fnc_serverRemoveBody
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_target"];
|
|
|
|
TRACE_2("",_target,isPlayer _target);
|
|
|
|
|
|
|
|
//Hide the body globaly
|
2016-06-03 19:38:16 +00:00
|
|
|
[QEGVAR(common,hideObjectGlobal), [_target, true]] call CBA_fnc_serverEvent;
|
2016-02-13 23:59:11 +00:00
|
|
|
|
|
|
|
if (isNil QGVAR(bodiesToDelete)) then {GVAR(bodiesToDelete) = [];};
|
|
|
|
GVAR(bodiesToDelete) pushBack _target;
|
|
|
|
|
2016-02-29 02:33:51 +00:00
|
|
|
// Start up a loop to wait for bodies to be free to delete
|
2016-06-21 17:13:32 +00:00
|
|
|
if ((count GVAR(bodiesToDelete)) == 1) then {
|
2016-02-29 02:33:51 +00:00
|
|
|
[] call FUNC(bodyCleanupLoop);
|
2016-02-13 23:59:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nil
|