[Fix] Fixed segfault in volatile nebulae.
This commit is contained in:
parent
31ec890d3e
commit
8f579ba9ac
11
src/pilot.c
11
src/pilot.c
@ -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. */
|
||||
/* should probably turn it into a partial conservative collision.. */
|
||||
vect_cadd(&p->solid->vel,
|
||||
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.)));
|
||||
if(w != NULL)
|
||||
/* Knock back effect is dependent on both damage and mass of the weapon. */
|
||||
/* should probably turn it into a partial conservative collision.. */
|
||||
vect_cadd(&p->solid->vel,
|
||||
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.)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user