First thing that I would do would be to comment out the A_SkullPop just to confirm that's where the issue lies.
Also, I was partially mis-remembering the issue. In my Burghead mod, the flashlight effect constantly performs a location check on the player. If the player dies with an extreme death, the check loses track of the player. (I don't recall exactly what happens with A_SkullPop but the player basically becomes disassociated with its corpse position - the "resurrect" console command doesn't work after a SkullPopped death either.)
So, anyway, if you have something in your mod that checks the player position (probably the altered movement code), then the null check needs to be in there to make sure that the player is still valid before doing the other stuff.
Here's what Ed the Bat did to fix the code in my mod:
Code: Select all
Spawn:
TNT1 A 1 NODELAY
{
if(target==null)
return state(null);
PlayerInfo player=target.player;
if(player==null)
return state(null);
angle=target.angle;
SetOrigin((target.pos.x,target.pos.y,target.pos.z+player.ViewHeight/4),true);
if(button)
return resolvestate("LWMFlashLight");
if(click)
{
click=0;
A_PlaySound("LWMFLClickOff");
}
return state(null);
}
Loop;
Note the lines checking for "player==null". That was the fix in my mod. However, if you need a technical explanation, or help on where to add it in your mod I'm sorry that I would be stabbing in the dark as much as anyone. However, someone might be able to figure it out if this is indeed where the problem lies.