smcameron / space-nerds-in-space

Multi-player spaceship bridge simulator game. Captain your starship through adventures with your friends. See https://smcameron.github.io/space-nerds-in-space
GNU General Public License v2.0
723 stars 73 forks source link

It would be nice if Lua script crashes could produce a stack trace on the demon screen. #306

Closed smcameron closed 1 year ago

smcameron commented 2 years ago

Might have to move from Lua 5.1 to Lua 5.2 for this.

There are some stackoverflow questions that seem relevant. I spent about a half hour trying to make something work, and couldn't.

https://stackoverflow.com/questions/12256455/print-stacktrace-from-c-code-with-embedded-lua

smcameron commented 1 year ago

Ok, this should be fixed now. BTW, I don't know what I meant by "Might have to move from Lua 5.1 to Lua 5.2 for this.", since digging through the logs, we've been using Lua 5.2 the entire time, the first commit using Lua is from 2013: 429a409dfd3e5b57c3900a39b24eec2cae3f1cd0 and it uses 5.2.

So, the following commits have been made:

Now we get nice Lua stacktraces like this:

Screenshot_2022-12-24_09-39-00