Debugging Lua errors that occur during loading a module or generating a level can be tricky. The game's standard error dialog is never invoked, and the loading / generating never finishes, so I have to kill the process and check the logfile, which may or may not have gotten the error message flushed to it.
If I understand the code correctly, having main.c's traceback call fflush(stdout); would ensure that Lua errors are always flushed to the log, regardless of what may go wrong at higher-level code or whether or not higher-level code is in a place to check for and display error dialogs.
fflush from traceback
Moderator: Moderator
Re: fflush from traceback
you can force constant flushing by running as te4.exe --flush-stdout in window. juse baretail.exe or similar to follow it.Castler wrote:Debugging Lua errors that occur during loading a module or generating a level can be tricky. The game's standard error dialog is never invoked, and the loading / generating never finishes, so I have to kill the process and check the logfile, which may or may not have gotten the error message flushed to it.
If I understand the code correctly, having main.c's traceback call fflush(stdout); would ensure that Lua errors are always flushed to the log, regardless of what may go wrong at higher-level code or whether or not higher-level code is in a place to check for and display error dialogs.
it will slow the game only slightly.
MADNESS rocks
Re: fflush from traceback
yup good idea
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
