diff --git a/src/pilot.c b/src/pilot.c index 0263b21..565818b 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -457,7 +457,7 @@ void pilot_hit(Pilot* p, const Solid* w, const unsigned int shooter, pilot_dead(p); /* Adjust the combat rating based on pilot mass and ditto faction. */ pshooter = pilot_get(shooter); - if(pshooter->faction == FACTION_PLAYER) { + if((pshooter != NULL) && (pshooter->faction == FACTION_PLAYER)) { mod = sqrt(p->ship->mass) / 5; player_crating += 2*mod; /* Crating chanes faster. */ faction_modPlayer(p->faction, -mod);