ACE3/addons/medical/functions/fnc_cleanUpCopyOfBody.sqf

26 lines
661 B
Plaintext
Raw Normal View History

2015-01-16 23:21:47 +00:00
/**
* fn_cleanUpCopyOfBody_f.sqf
* @Descr: Called from a custom eventhandler to ensure that any copies of bodies are cleaned up.
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: BOOL
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit", "_copy"];
_unit = _this select 0;
_copy = _unit getvariable QGVAR(copyOfBody);
2015-01-16 23:21:47 +00:00
if (isnil "_copy") exitwith {false};
[format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call EFUNC(common,debug);
2015-01-16 23:21:47 +00:00
// lets clean it up
_unit setvariable [QGVAR(originalCopy), nil, true];
_unit setvariable [QGVAR(copyOfBody), nil, true];
2015-01-16 23:21:47 +00:00
if (!isNull _copy) then {
2015-01-18 19:09:19 +00:00
deleteVehicle _copy;
2015-01-16 23:21:47 +00:00
};
true;