Code review comment for lp:~widelands-dev/widelands/autosave_on_objectives

Revision history for this message
SirVer (sirver) wrote :

This is the error you get when Lua tries to persist a running coroutine. So this is precisely the error you want to fix :).

In trunk, the save routine must only be called when no coroutine is running, i.e. outside of any coroutine, i.e. when the script is run the first time. This is not very flexible and means that you can essentially not save from inside Lua. I did it because I needed a save routine for the persistence test and this did the job.

Your code now should be able to handle this though, because as soon as you hit the main loop and poll if the game should be saved, there cannot be a Lua coroutine running anymore, so saving should work.

« Back to merge proposal