Skip to content

Commit

Permalink
fix: restores state on returning; for some reason, previously state w…
Browse files Browse the repository at this point in the history
…as modified but never restored.
  • Loading branch information
BHSDuncan authored and StraToN committed Dec 9, 2022
1 parent 328e5ef commit 9398ce9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ func run():
self,
"Starting dialog."
)

# Since we're changing state, we need to remember and reset it once we're done
var previous_state = escoria.current_state
escoria.current_state = escoria.GAME_STATE.DIALOG

if !escoria.dialog_player:
escoria.dialog_player = escoria.main.current_scene.get_node(
"game/ui/dialog_layer/dialog_player"
Expand All @@ -103,4 +107,6 @@ func run():
if rc != ESCExecution.RC_CANCEL:
return self.run()

escoria.current_state = previous_state

return rc

0 comments on commit 9398ce9

Please sign in to comment.