Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve zeus auto-add XEH behaviour #3948

Merged
merged 1 commit into from
Jun 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions addons/zeus/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,3 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

class Extended_InitPost_EventHandlers {
class AllVehicles {
class ADDON {
serverInit = QUOTE(call FUNC(addObjectToCurator));
};
};
};
7 changes: 7 additions & 0 deletions addons/zeus/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#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
QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill);

Expand Down
5 changes: 0 additions & 5 deletions addons/zeus/functions/fnc_addObjectToCurator.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@

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 {};

[{
Expand Down