The weapon filters it down to all the NPCs in a given radius, puts them in an array, and then a Think function blows them up one after another over a couple seconds. The problem is, if another player kills an NPC in that array before the function gets to them, the engine crashes because it's trying to apply damage to something non-existent.
This seems easy, all I need to do here is check if the NPC is still around before trying to damage it. I tried reading various variables and stuff that are part of the NPC, but they all return garbage once it's dead. ->IsAlive and ->IsNPC both crash the game. Dead things pass a != NULL check.
So, short version:
How do I safely check if an entity exists/is valid?