Making it print the stack was easier than expected, will submit the function as
attachment (each unique 'lua_State *L' is a different thread).
I called the function in 'run_lua' at the start, on error, and at the end.
This was the result of a trial run (load Test save file and talk to droid):
(... the Test save file was loaded ...)
START run_lua:
thread address 0x5622368
stack size 0
END run_lua:
thread address 0x5622368
stack size 0
(... dialog reached the Tux:end_quest call ...)
START run_lua:
thread address 0x5622368
stack size 1
[-1] thread:
thread address 0x18481d8
stack size 3
[-1] string "I found Ewald's 296 alive and well in Ewald's bar! I was sure it
was destroyed in that explosion I heard, but it's safe and sound. Well, I guess
all's well that ends well."
[-2] string "An Explosive Situation"
[-3] userdata 0x1af9118
ERROR run_lua:
thread address 0x5622368
stack size 2
[-1] string "attempt to yield from outside a coroutine"
[-2] thread:
thread address 0x18481d8
stack size 3
[-1] string "I found Ewald's 296 alive and well in Ewald's bar! I was sure it
was destroyed in that explosion I heard, but it's safe and sound. Well, I guess
all's well that ends well."
[-2] string "An Explosive Situation"
[-3] userdata 0x1af9118
(... error message from pretty_print_lua_error goes here ...)
END run_lua:
thread address 0x5622368
stack size 0
The requirements to trigger this appear to be:
1) use 'update_quest' inside the 'completion_code' of the quest being updated;
2) end the quest when the dialog is open.
It appears the code after the error was executed properly. |