Open Civil opened 8 years ago
If I'll add simple check there (if pain_anim is -1 PickAnim from pain1 to pain18), it'll fail in another place:
Program received signal SIGABRT, Aborted.
0x00007ffff66b2528 in raise () from /lib64/libc.so.6
(gdb) backtrace
#0 0x00007ffff66b2528 in raise () from /lib64/libc.so.6
#1 0x00007ffff66b397a in abort () from /lib64/libc.so.6
#2 0x00007ffff66ab417 in __assert_fail_base () from /lib64/libc.so.6
#3 0x00007ffff66ab4c2 in __assert_fail () from /lib64/libc.so.6
#4 0x00007fffcfddda1c in AddSightEvent (owner=0x7fffd08b90b0 <g_entities+523600>, position=0x7fffd0889484 <g_entities+327972>, radius=512, alertLevel=AEL_DISCOVERED, addLight=0)
at /home/civil/src/OpenJK-civil/code/game/NPC_senses.cpp:831
#5 0x00007fffcfc05ab2 in G_CheckSpecialPersistentEvents (ent=0x7fffd0889328 <g_entities+327624>) at /home/civil/src/OpenJK-civil/code/game/g_main.cpp:1036
#6 0x00007fffcfbfa939 in G_RunFrame (levelTime=309000) at /home/civil/src/OpenJK-civil/code/game/g_main.cpp:1977
#7 0x000000000064ee02 in SV_Frame (msec=52, fractionMsec=0) at /home/civil/src/OpenJK-civil/code/server/sv_main.cpp:513
#8 0x00000000005d4d43 in Com_Frame () at /home/civil/src/OpenJK-civil/code/qcommon/common.cpp:1391
#9 0x00000000007570ee in main (argc=1, argv=0x7fffffffd838) at /home/civil/src/OpenJK-civil/shared/sys/sys_main.cpp:789
(gdb) frame 4
#4 0x00007fffcfddda1c in AddSightEvent (owner=0x7fffd08b90b0 <g_entities+523600>, position=0x7fffd0889484 <g_entities+327972>, radius=512, alertLevel=AEL_DISCOVERED, addLight=0)
at /home/civil/src/OpenJK-civil/code/game/NPC_senses.cpp:831
831 assert( !Q_isnan(position[0]) && !Q_isnan(position[1]) && !Q_isnan(position[2]) );
(gdb) info local
No locals.
(gdb) print position[0]
$1 = 0
(gdb) print position[1]
$2 = 0
(gdb) print position[2]
$3 = -nan(0x7f88f0)
(gdb) frame 5
#5 0x00007fffcfc05ab2 in G_CheckSpecialPersistentEvents (ent=0x7fffd0889328 <g_entities+327624>) at /home/civil/src/OpenJK-civil/code/game/g_main.cpp:1036
1036 AddSightEvent( ent->owner, ent->currentOrigin, 512, AEL_DISCOVERED );
(gdb) info local
No locals.
(gdb) print ent->currentOrigin
$4 = {0, 0, -nan(0x7f88f0)}
(gdb) frame 6
#6 0x00007fffcfbfa939 in G_RunFrame (levelTime=309000) at /home/civil/src/OpenJK-civil/code/game/g_main.cpp:1977
1977 G_CheckSpecialPersistentEvents( ent );
(gdb) info local
i = 219
ent = 0x7fffd0889328 <g_entities+327624>
ents_inuse = 213
(gdb) print ent->currentOrigin
$5 = {0, 0, -nan(0x7f88f0)}
(gdb) q
A debugging session is active.
Inferior 1 [process 25257] will be killed.
Quit anyway? (y or n) y
Duplicate bug more or less.
Well, sorry, I haven't found similar bug.
Fixed in 92059a6b? Same for #698 , #696, #661?
It looks like there's a similiar issue here: https://github.com/JACoders/OpenJK/blob/07675e20746741bc16a712cbf1c9847a5e4a0029/codemp/game/NPC_reactions.c#L366
?
I haven't checked the repo since basically 2016, the hacks I've originally suggested made it stable enough to finish and since then I haven't played it and currently I don't plan to play it again in near future. So I guess it can be closed even if it's not fixed as I won't be able to provide more debug information about the problem.