Closed davcri closed 2 years ago
I think this will crash if pre_start
has no yield
in it -
to avoid a crash:
if instanced_scn.has_method("pre_start"):
var coroutine_state = instanced_scn.pre_start(_params)
if coroutine_state is GDScriptFunctionState && coroutine_state.is_valid():
# wait for coroutine to finish...
yield(coroutine_state, "completed")
# else... this is a normal function that just ended
You're right! Thanks for providing the fix! In the future feel free to open a pull request :)
See https://github.com/crystal-bit/godot-game-template/commit/9aa7076fc53f98ca9ba50f34b78f6cac7457636b