mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Improve zeus auto-add XEH behaviour
The XEH InitPost event only needs to be added if the `GVAR(autoAddObjects)` setting is enabled. This change will save on overhead when the setting is disabled and also removes some complexity from the function that runs in response to the event.
This commit is contained in:
parent
72092d6464
commit
ca01f31b52
@ -16,11 +16,3 @@ class Extended_PostInit_EventHandlers {
|
|||||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_InitPost_EventHandlers {
|
|
||||||
class AllVehicles {
|
|
||||||
class ADDON {
|
|
||||||
serverInit = QUOTE(call FUNC(addObjectToCurator));
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
["ace_settingsInitialized",{
|
||||||
|
// Only add an InitPost EH if setting is enabled (and apply retroactively)
|
||||||
|
if (isServer && GVAR(autoAddObjects)) then {
|
||||||
|
["AllVehicles", "InitPost", FUNC(addObjectToCurator), true, [], true] call CBA_fnc_addClassEventHandler;
|
||||||
|
};
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
// Global skill module PVs values for persistence, just listen for the PV
|
// Global skill module PVs values for persistence, just listen for the PV
|
||||||
QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill);
|
QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill);
|
||||||
|
|
||||||
|
@ -15,11 +15,6 @@
|
|||||||
|
|
||||||
params ["_object"];
|
params ["_object"];
|
||||||
|
|
||||||
if !(EGVAR(common,settingsInitFinished)) exitWith {
|
|
||||||
TRACE_1("pushing to runAtSettingsInitialized", _this);
|
|
||||||
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addObjectToCurator), _this];
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitWith {};
|
if (!(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitWith {};
|
||||||
|
|
||||||
[{
|
[{
|
||||||
|
Loading…
Reference in New Issue
Block a user