While I was investigating a crash in a zandronum
ticket, I noticed that repeating the 'dying npc' process in zdoom, no crash happened in src/g_strife/a_strifeitems.cpp:
Code: Select all
if (dropper->target->CheckLocalView (consoleplayer))
even though dropper->target is NULL. Inside CheckLocalView there's no direct access to any member variable, but it's still undefined behavior according to the C++ Standard. What do you think? Is it correct that the npc has no target when it dies?
Steps for zdoom:
- (developer) put a breakpoint at the line above;
- load zdoom with: `zdoom -iwad doom2.wad -file npccrash_01.wad -warp 01 -skill 4` ;
- press '+attack' once against one marine and wait that it dies because of the wounds.