You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i discovered last night that if you try to use Lua to create a scenery item with a sequence set to “display a random frame” with zero frames per view (i’m a dingus and forgot to save my shapes file), the game crashes without explanation (on Windows, Linux, and presumably Intel Macs, at least) due to a floating-point exception (i.e., division by zero). this line in map.cpp appears to be the culprit:
global_random()%animation->frames_per_view
here’s the top of a stack trace that Solra ran in Valgrind:
#0 0x0000555555624af3 in randomize_object_sequence(short, unsigned short)
(object_index=object_index@entry=109, shape=<optimized out>)
at map.cpp:1147
#1 0x0000555555644969 in randomize_scenery_shape(short)
(object_index=<optimized out>, object_index@entry=109) at scenery.cpp:143
#2 0x00005555556da2b3 in Lua_Sceneries_New(lua_State*) (L=0x55555673e010)
at lua_objects.cpp:768
i’m guessing this problem also occurs with items, ephemera, effects, and possibly monsters, though i haven’t actually confirmed this.
in any case, i plan to make a PR that makes an assertion to detect this error and present a helpful error message rather than crash without explanation, so that the next time someone has this problem, they don’t waste five hours of their life thinking faulty Lua caused the crash. not that i know anyone this has happened to.
(thanks to Solra for the stack trace and for identifying the line that was causing the issue.)
The text was updated successfully, but these errors were encountered:
i discovered last night that if you try to use Lua to create a scenery item with a sequence set to “display a random frame” with zero frames per view (i’m a dingus and forgot to save my shapes file), the game crashes without explanation (on Windows, Linux, and presumably Intel Macs, at least) due to a floating-point exception (i.e., division by zero). this line in map.cpp appears to be the culprit:
global_random()%animation->frames_per_view
here’s the top of a stack trace that Solra ran in Valgrind:
i’m guessing this problem also occurs with items, ephemera, effects, and possibly monsters, though i haven’t actually confirmed this.
in any case, i plan to make a PR that makes an assertion to detect this error and present a helpful error message rather than crash without explanation, so that the next time someone has this problem, they don’t waste five hours of their life thinking faulty Lua caused the crash. not that i know anyone this has happened to.
(thanks to Solra for the stack trace and for identifying the line that was causing the issue.)
The text was updated successfully, but these errors were encountered: