Skip to content

Commit 7b7246e

Browse files
committed
[[ Bug ]] Resolve behaviors after loading auxiliary stacks
This patch ensures that the behaviors of the mainstack of a stndalone are resolved after all the stacks are loaded from the auxiliary stacks. This was already the case for mobile, however, for some reason it was `#ifdef`'d out for other platforms.
1 parent a76d135 commit 7b7246e

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

engine/src/dispatch.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,16 +522,10 @@ IO_stat MCDispatch::readstartupstack(IO_handle stream, MCStack*& r_stack)
522522
// crash when searching substacks.
523523
stacks = t_stack;
524524

525-
#ifndef _MOBILE
526-
// Make sure parent script references are up to date.
527-
if (s_loaded_parent_script_reference)
528-
t_stack -> resolveparentscripts();
529-
#else
530525
// Mark the stack as needed parentscript resolution. This is done after
531526
// aux stacks have been loaded.
532527
if (s_loaded_parent_script_reference)
533528
t_stack -> setextendedstate(True, ECS_USES_PARENTSCRIPTS);
534-
#endif
535529

536530
r_stack = t_stack;
537531
return IO_NORMAL;

engine/src/mode_standalone.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,11 @@ IO_stat MCDispatch::startup(void)
930930

931931
// Now open the main stack.
932932
t_mainstack-> extraopen(false);
933+
934+
// Resolve parent scripts *after* we've loaded aux stacks.
935+
if (t_mainstack -> getextendedstate(ECS_USES_PARENTSCRIPTS))
936+
t_mainstack -> resolveparentscripts();
937+
933938
send_startup_message();
934939
if (!MCquit)
935940
t_mainstack -> open();

0 commit comments

Comments
 (0)