mirror of
https://github.com/JohnBreaux/Boat-Battle.git
synced 2024-11-15 05:25:57 +00:00
Debug: I lied. Ran into a bug regarding state save/restore when nesting scripts.
This commit is contained in:
parent
b8d0e008d1
commit
6758dc048e
@ -539,16 +539,21 @@ func command_script(command):
|
|||||||
script.push_back(f.get_line())
|
script.push_back(f.get_line())
|
||||||
f.close()
|
f.close()
|
||||||
# Save state and turn off echo
|
# Save state and turn off echo
|
||||||
|
var state = {"echo": echo,
|
||||||
|
"pwn": present_working_node,
|
||||||
|
"history_pos": history_pos,
|
||||||
|
"history": history,
|
||||||
|
"expression": expression}
|
||||||
echo = false
|
echo = false
|
||||||
var pwn = present_working_node
|
|
||||||
var h = history_pos
|
|
||||||
# Execute the script
|
# Execute the script
|
||||||
for cmd in script:
|
for cmd in script:
|
||||||
_on_LineEdit_text_entered(cmd)
|
_on_LineEdit_text_entered(cmd)
|
||||||
# Restore state and turn on echo
|
# Restore state
|
||||||
present_working_node = pwn
|
echo = state["echo"]
|
||||||
history_pos = h
|
present_working_node = state["pwn"]
|
||||||
echo = true
|
history_pos = state["history_pos"]
|
||||||
|
history = state["history"]
|
||||||
|
expression = state["expression"]
|
||||||
else:
|
else:
|
||||||
debug_print_line("File not found: " + command[1] + "\n")
|
debug_print_line("File not found: " + command[1] + "\n")
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user