ACE3/addons/medical_treatment/functions/fnc_serverRemoveBody.sqf
Dedmen Miller 7a0a00ea09 Cleanup using SQFLint (#6485)
* Use private
* Fix wrong spacing
* Fix wrong variable being used
* Cleanup empty line after header
* ace_common_fnc_getCountOfItem
* Remove useless _return variable
* Naming
2018-08-02 15:02:10 +01:00

34 lines
802 B
Plaintext

#include "script_component.hpp"
/*
* 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:
* None
*
* Example:
* [cursorTarget] call ace_medical_treatment_fnc_serverRemoveBody
*
* Public: No
*/
params ["_target"];
TRACE_2("",_target,isPlayer _target);
// Hide the body globaly
[QEGVAR(common,hideObjectGlobal), [_target, true]] call CBA_fnc_serverEvent;
if (isNil QGVAR(bodiesToDelete)) then {GVAR(bodiesToDelete) = [];};
GVAR(bodiesToDelete) pushBack _target;
// Start up a loop to wait for bodies to be free to delete
if ((count GVAR(bodiesToDelete)) == 1) then {
[] call FUNC(bodyCleanupLoop);
};
nil