[Fix] Death explosions.

This commit is contained in:
Allanis 2013-03-20 21:36:32 +00:00
parent 9ea3f985d2
commit 927280f778

View File

@ -307,8 +307,8 @@ void pilot_render(Pilot* p) {
// Update the pilot. // Update the pilot.
static void pilot_update(Pilot* pilot, const double dt) { static void pilot_update(Pilot* pilot, const double dt) {
unsigned int t; unsigned int t, l;
double px, py, vx, vy; double a, px, py, vx, vy;
if(pilot_isFlag(pilot, PILOT_DEAD)) { if(pilot_isFlag(pilot, PILOT_DEAD)) {
t = SDL_GetTicks(); t = SDL_GetTicks();
@ -332,17 +332,17 @@ static void pilot_update(Pilot* pilot, const double dt) {
(double)(pilot->ptimer - pilot->timer[0])); (double)(pilot->ptimer - pilot->timer[0]));
// Random position on ship. // Random position on ship.
px = VX(pilot->solid->pos) + pilot->ship->gfx_space->sw * RNGF() a = RNGF()*2.*M_PI;
- pilot->ship->gfx_space->sw/2.; px = VX(pilot->solid->pos) + cos(a)*RNGF()*pilot->ship->gfx_space->sw/2.;
py = VY(pilot->solid->pos) + pilot->ship->gfx_space->sh * RNGF() py = VY(pilot->solid->pos) + sin(a)*RNGF()*pilot->ship->gfx_space->sh/2.;
- pilot->ship->gfx_space->sh/2.;
vx = VX(pilot->solid->vel); vx = VX(pilot->solid->vel);
vy = VY(pilot->solid->vel); vy = VY(pilot->solid->vel);
if(RNGF() > 0.8) // Set explosions.
spfx_add(spfx_get("ExpM"), px, py, vx, vy, SPFX_LAYER_BACK); l = (pilot->id == PLAYER_ID) ? SPFX_LAYER_FRONT : SPFX_LAYER_BACK;
else if(RNGF() > 0.8) spfx_add(spfx_get("ExpM"), px, py, vx, vy, l);
spfx_add(spfx_get("ExpS"), px, py, vx, vy, SPFX_LAYER_BACK); else spfx_add(spfx_get("ExpS"), px, py, vx, vy, l);
} }
} }
else if(pilot->armour <= 0.) // PWNED! else if(pilot->armour <= 0.) // PWNED!