2016-06-30 15:33:29 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ADDON = false;
|
|
|
|
|
|
|
|
#include "XEH_PREP.hpp"
|
|
|
|
|
2016-09-26 18:25:14 +00:00
|
|
|
call FUNC(parseConfigForInjuries);
|
|
|
|
|
2017-03-18 14:13:08 +00:00
|
|
|
addMissionEventHandler ["Loaded",{
|
|
|
|
INFO("Mission Loaded - Reloading medical configs for extension");
|
|
|
|
// Reload configs into extension (handle full game restart)
|
|
|
|
call FUNC(parseConfigForInjuries);
|
|
|
|
}];
|
|
|
|
|
2016-12-06 09:59:29 +00:00
|
|
|
// decide which woundsHandler to use by whether the extension is present or not
|
|
|
|
if ("ace_medical" callExtension "version" != "") then {
|
|
|
|
DFUNC(woundsHandlerActive) = FUNC(woundsHandler);
|
|
|
|
} else {
|
|
|
|
DFUNC(woundsHandlerActive) = FUNC(woundsHandlerSQF);
|
|
|
|
};
|
|
|
|
|
2016-09-18 12:05:05 +00:00
|
|
|
[QEGVAR(medical_engine,woundReceived), {
|
2016-08-27 07:39:24 +00:00
|
|
|
params ["_unit", "_woundedHitPoint", "_receivedDamage", "", "_ammo"];
|
|
|
|
|
|
|
|
private _typeOfDamage = _ammo call FUNC(getTypeOfDamage);
|
2016-12-06 09:59:29 +00:00
|
|
|
[_unit, _woundedHitPoint, _receivedDamage, _ammo, _typeOfDamage] call FUNC(woundsHandlerActive);
|
2016-09-18 17:48:49 +00:00
|
|
|
|
2016-09-27 17:22:54 +00:00
|
|
|
[_unit, EGVAR(medical,STATE_MACHINE)] call EFUNC(medical,addStateHandler);
|
2016-08-27 07:39:24 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2016-06-30 15:33:29 +00:00
|
|
|
|
|
|
|
ADDON = true;
|