mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
|
#include "script_component.hpp"
|
||
|
|
||
|
GVAR(useAceMedical) = ["ace_medical"] call EFUNC(common,isModLoaded);
|
||
|
|
||
|
// To support public API regardless of component settings
|
||
|
[QGVAR(spurt), {
|
||
|
_this call FUNC(spurt);
|
||
|
}] call CBA_fnc_addEventHandler;
|
||
|
|
||
|
if (isServer) then {
|
||
|
GVAR(bloodDrops) = [];
|
||
|
|
||
|
[QGVAR(bloodDropCreated), {
|
||
|
params ["_bloodDrop"];
|
||
|
GVAR(bloodDrops) pushBack _bloodDrop;
|
||
|
if (count GVAR(bloodDrops) >= 500) then {
|
||
|
private _deletedBloodDrop = GVAR(bloodDrops) deleteAt 0;
|
||
|
deleteVehicle _deletedBloodDrop;
|
||
|
};
|
||
|
|
||
|
[{
|
||
|
params ["_bloodDrop"];
|
||
|
deleteVehicle _bloodDrop;
|
||
|
}, [_bloodDrop], 900] call CBA_fnc_waitAndExecute;
|
||
|
}] call CBA_fnc_addEventHandler;
|
||
|
};
|
||
|
|
||
|
["ace_settingsInitialized", {
|
||
|
TRACE_1("settingsInitialized", GVAR(enabledFor));
|
||
|
if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled
|
||
|
|
||
|
[configFile >> QGVAR(stateMachine)] call CBA_statemachine_fnc_createFromConfig;
|
||
|
|
||
|
["CAManBase", "hit", {
|
||
|
params ["_unit"];
|
||
|
if (GVAR(enabledFor) == 1 && {!isPlayer _unit || {_unit == ACE_player}}) exitWith {};
|
||
|
_this call FUNC(hit);
|
||
|
}] call CBA_fnc_addClassEventHandler;
|
||
|
|
||
|
}] call CBA_fnc_addEventHandler;
|