[Fix] Fixed segfault in volatile nebulae.

This commit is contained in:
Allanis 2014-05-17 13:15:08 +01:00
parent 31ec890d3e
commit 8f579ba9ac

View File

@ -461,11 +461,12 @@ void pilot_hit(Pilot* p, const Solid* w, const unsigned int shooter,
} }
} }
/* Knock back effect is dependent on both damage and mass of the weapon. */ if(w != NULL)
/* should probably turn it into a partial conservative collision.. */ /* Knock back effect is dependent on both damage and mass of the weapon. */
vect_cadd(&p->solid->vel, /* should probably turn it into a partial conservative collision.. */
knockback * (w->vel.x * (dam_mod/6. + w->mass/p->solid->mass/6.)), vect_cadd(&p->solid->vel,
knockback * (w->vel.y * (dam_mod/6. + w->mass/p->solid->mass/6.))); knockback * (w->vel.x * (dam_mod/6. + w->mass/p->solid->mass/6.)),
knockback * (w->vel.y * (dam_mod/6. + w->mass/p->solid->mass/6.)));
} }
/** /**