diff --git a/addons/medical/XEH_PREP.hpp b/addons/medical/XEH_PREP.hpp index 7ea54d8fdd..d1e4be28c2 100644 --- a/addons/medical/XEH_PREP.hpp +++ b/addons/medical/XEH_PREP.hpp @@ -2,6 +2,7 @@ PREP(addDamageToUnit); PREP(addStateHandler); PREP(adjustPainLevel); +PREP(bodyCleanupLoop); PREP(conditionCardiacArrestTimer); PREP(conditionExecutionDeath); PREP(displayPatientInformation); diff --git a/addons/medical/functions/fnc_bodyCleanupLoop.sqf b/addons/medical/functions/fnc_bodyCleanupLoop.sqf new file mode 100644 index 0000000000..af17ffcd34 --- /dev/null +++ b/addons/medical/functions/fnc_bodyCleanupLoop.sqf @@ -0,0 +1,30 @@ +/* + * Author: Glowbal, esteldunedain + * Loop that cleans up litter + * + * Arguments: + * None + * + * ReturnValue: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +{ + TRACE_2("body",_x,isPlayer _x); + if ((!isNull _x) && {!isPlayer _x}) then {deleteVehicle _x}; +} forEach GVAR(bodiesToDelete); + +// deleteVehicle doesn't have instant results so it won't usualy be filtered until next run +GVAR(bodiesToDelete) = GVAR(bodiesToDelete) - [objNull]; + +// If no more bodies remain, exit the loop +if (GVAR(bodiesToDelete) isEqualTo []) exitWith { + TRACE_1("array emptied - rem PFEH",GVAR(bodiesToDelete)); +}; + +// Schedule the loop to be executed again 20 sec later +[DFUNC(bodyCleanupLoop), [], 20] call CBA_fnc_waitAndExecute; diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf index 347c4c6021..24739a9e06 100644 --- a/addons/medical_engine/XEH_preInit.sqf +++ b/addons/medical_engine/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // Hack for #3168 (units in static weapons do not take any damage): // Doing a manual pre-load with a small distance seems to fix the LOD problems diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index 1218124ed1..a2380fae00 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -226,7 +226,7 @@ class GVAR(Actions) { allowSelfTreatment = 0; requiredMedic = 0; treatmentTime = 15; - items[] = {"ACE_BodyBag"}; + items[] = {"ACE_bodyBag"}; condition = "!alive _target"; callbackSuccess = QFUNC(actionPlaceInBodyBag); callbackFailure = ""; diff --git a/addons/medical_treatment/XEH_preInit.sqf b/addons/medical_treatment/XEH_preInit.sqf index 44bccbee3e..5970208062 100644 --- a/addons/medical_treatment/XEH_preInit.sqf +++ b/addons/medical_treatment/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // config to determine animation acceleration coefficient // adjusting these is trail and error