[Fix] Killed chances of possible seg fault.
This commit is contained in:
parent
812321b07d
commit
108d4f1c72
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user