-
Notifications
You must be signed in to change notification settings - Fork 150
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
Always re-run preInit on mission load/new #685
Conversation
addons/xeh/fnc_initDisplay3DEN.sqf
Outdated
|
||
add3DENEventHandler ["OnMissionNew", _fnc_preInitMissionConfig]; | ||
add3DENEventHandler ["OnMissionLoad", _fnc_preInitMissionConfig]; | ||
add3DENEventHandler ["OnMissionNew", {[] call CBA_fnc_preInit}]; |
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.
Going from one terrain to another
"OnMissionNew"
XEH: missionNamespace processed [false]
[83008,343.676,0,"XEH: PreInit started. v3.3.1.170504"]
[83008,344.812,0,"XEH: PreInit finished."]
"OnTerrainNew"
XEH: missionNamespace processed [false]
83008,346.107,0,"XEH: PreInit started. v3.3.1.170504"]
both events happen on the same frame, but missionNamespace is wiped between them
OnTerrainNew
seems to be last, so if we don't add the event, nothing will be defined
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.
OnTerrainNew is still needed as it fires after OnMissionLoad and the missionNamespace get's wiped inbetween them for whatever reason.
|
To the 2nd point, doesn't really matter imo. preInit is mainly copying over stuff from ui namespace via PREP. 1st one. Why would loading a mission fail? |
And that opens an empty mission on the same map as selected, right? |
yea |
I don't like how convoluted this has become. All 3 events are needed, but they all fire, because BI keeps wiping the namespace. |
This would catch the mission load failed problem, could possibly replace all other events?
|
Yeah, I like this more. |
This also fixes the multiple running of preInit |
} forEach (missionConfigFile call CBA_fnc_compileEventHandlers); | ||
private _fnc_watchDog = { | ||
if (!ISPROCESSED(missionNamespace)) then { | ||
diag_log text format ["XEH: missionNamespace processed [%1]", ISPROCESSED(missionNamespace)]; |
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.
ISPROCESSED(missionNamespace)
is always false, because that is the condition of the if
.
Works and fixes #684. |
Should fix #684
Seems like in 1.70, missionnamespace alwayse gets cleared out
(which seems good, just causes some problems)