Fix body-bag action / cleanup

This commit is contained in:
PabstMirror 2016-12-09 21:03:52 -06:00
parent ee864b2c46
commit b87bdfe14a
5 changed files with 36 additions and 1 deletions

View File

@ -2,6 +2,7 @@
PREP(addDamageToUnit);
PREP(addStateHandler);
PREP(adjustPainLevel);
PREP(bodyCleanupLoop);
PREP(conditionCardiacArrestTimer);
PREP(conditionExecutionDeath);
PREP(displayPatientInformation);

View File

@ -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;

View File

@ -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

View File

@ -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 = "";

View File

@ -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