-
Notifications
You must be signed in to change notification settings - Fork 148
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
Handle initPost EH added during PostInit #736
Conversation
@@ -73,6 +73,8 @@ _entities = _entities arrayIntersect _entities; // entities can return duplicate | |||
|
|||
//Run initReto now if the unit has already been initialized | |||
if (_applyInitRetroactively && {ISINITIALIZED(_unit)}) then { | |||
// If PostInit has not finisehd exit as it will be run via initPostStack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finisehd
@@ -73,6 +73,8 @@ _entities = _entities arrayIntersect _entities; // entities can return duplicate | |||
|
|||
//Run initReto now if the unit has already been initialized | |||
if (_applyInitRetroactively && {ISINITIALIZED(_unit)}) then { | |||
// If PostInit has not finisehd exit as it will be run via initPostStack | |||
if ((_eventName == "initpost") && {!(SLX_XEH_MACHINE select 8)}) exitWith {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition could be moved to parent if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ugly:
if (_applyInitRetroactively && {ISINITIALIZED(_unit) && {_eventName != "initPost" || {SLX_XEH_MACHINE select 8}}}) then {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works
Should fix #567
Before:
PreInit Runs
Unit Init runs (unit gets initilized var set)
PostInit Starts
Adds InitPost EH to unit, which would run immediately (PROBLEM).
PostInit finishes by running through
GVAR(initPostStack)
and run all initPost EHs