diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 587665943f..8b3f6b4f37 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -39,6 +39,7 @@ PREP(treatmentTourniquet); PREP(treatmentTourniquetLocal); PREP(addToLog); PREP(addToTriageCard); +PREP(actionPlaceInBodyBag); GVAR(injuredUnitCollection) = []; call FUNC(parseConfigForInjuries); diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf new file mode 100644 index 0000000000..ef04026da6 --- /dev/null +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -0,0 +1,39 @@ +/* + * Author: Glowbal + * Replace a dead body by a bodybag + * + * Arguments: + * 0: The patient + * 1: The new item classname + * + * Return Value: + * nil + * + * Public: Yes + */ + +#include "script_component.hpp" + +private ["_target","_caller", "_nameOfUnit", "_onPosition", "_bodyBagCreated"]; +_caller = _this select 0; +_target = _this select 1; + +if !([_caller, "ACE_itemBodyBag"] call EFUNC(common,hasItem)) exitwith {}; + +[_caller, "ACE_itemBodyBag"] call EFUNC(common,useItem); + +_nameOfUnit = [_unit] call EFUNC(common,getName); +if (alive _unit) then { + // force kill the unit. + [_unit, true] call FUNC(setDead); +}; +_onPosition = getPos _unit; +deleteVehicle _unit; +_bodyBagCreated = createVehicle ["ACE_bodyBag", _onPosition, [], 0, "NONE"]; +// reset the position to ensure it is on the correct one. +_bodyBagCreated setPos _onPosition; + +// TODO Does this need to be something with QUOTE(DEFUNC)? +[[_bodyBagCreated], QEFUNC(common,revealObject), true] call call EFUNC(common,execRemoteFnc); + +_bodyBagCreated; diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index d36be6d0aa..db752396e5 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -1,11 +1,17 @@ -/** - * fn_addActivityToLog.sqf - * @Descr: adds an item to the activity log - * @Author: Glowbal +/* + * Author: Glowbal + * Add an entry to the specified log * - * @Arguments: [unit OBJECT, type STRING, message STRING] - * @Return: - * @PublicAPI: false + * Arguments: + * 0: The patient + * 1: The log type + * 2: The message + * 3: The arguments for localization + * + * Return Value: + * nil + * + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index cc9d4c7f5e..00aeab9b24 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -1,11 +1,15 @@ -/** - * fn_addToTriageList.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal + * Add an entry to the triage card * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * 0: The patient + * 1: The new item classname + * + * Return Value: + * nil + * + * Public: Yes */ #include "script_component.hpp"