[2.2.13] Lua: Checking for P_PlayerInPain while in Match Mode causes a crash
Title says it all; if you try to check P_PlayerInPain while the Match gamemode is going on, the game instantly crashes when a player is spawned. Specifically I tested this on a multiplayer server; self-hosted games have this happen too (i.e. go to the multiplayer menu, start a server from match mode or switch to it, then enter the game). Unsure if it affects other multiplayer gamemodes besides match, all I know is that co-op is fine, and singleplayer works fine too.
Provided is a simple lua script that simply causes the crash immediately. And indeed, if you go in-game on anything else, this doesn't crash, and does print "a" whenever the player is currently in pain. match-test.lua
Oh, and here's a crash log:
------------------------
An error occurred within SRB2! Send this stack trace to someone who can help!
Time of crash: Sat, 17 Aug 2024 14:41:49 -0400
Cause: Segmentation fault
Backtrace:
lsdl2srb2(+0x8edd4)[0x55fb55f50dd4]
lsdl2srb2(+0x8ef03)[0x55fb55f50f03]
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x3ee80)[0x7f4e25651e80]
lsdl2srb2(P_PlayerInPain+0x7)[0x55fb5609bc27]
lsdl2srb2(+0x24bbde)[0x55fb5610dbde]
lsdl2srb2(+0x27114f)[0x55fb5613314f]
lsdl2srb2(+0x284d75)[0x55fb56146d75]
lsdl2srb2(+0x27167f)[0x55fb5613367f]
lsdl2srb2(+0x270ab9)[0x55fb56132ab9]
lsdl2srb2(+0x271807)[0x55fb56133807]
lsdl2srb2(lua_pcall+0x61)[0x55fb56130c3f]
lsdl2srb2(+0x2521eb)[0x55fb561141eb]
lsdl2srb2(+0x2523f1)[0x55fb561143f1]
lsdl2srb2(+0x2525cb)[0x55fb561145cb]
lsdl2srb2(LUA_HookPlayer+0xcc)[0x55fb56114fd8]
lsdl2srb2(P_Ticker+0x4de)[0x55fb560973cf]
lsdl2srb2(G_Ticker+0x10f8)[0x55fb55fc5ec3]
lsdl2srb2(TryRunTics+0x19e)[0x55fb55f88b99]
lsdl2srb2(D_SRB2Loop+0x16e)[0x55fb55f7c4cf]
lsdl2srb2(main+0x92)[0x55fb55f501e2]
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x2808a)[0x7f4e2563b08a]
/usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b)[0x7f4e2563b14b]
lsdl2srb2(_start+0x25)[0x55fb55f50415]