From 2e5606b8452d5a3a537e975a777f42fda4664d68 Mon Sep 17 00:00:00 2001 From: Allanis Date: Thu, 2 May 2013 20:29:16 +0100 Subject: [PATCH] [Fix] It's a seldom bug, but this will stop us from exploding while entering into hyperspace. --- src/pilot.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pilot.c b/src/pilot.c index fee9b80..4609ad3 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -266,6 +266,13 @@ void pilot_dead(Pilot* p) { p->timer[0] = SDL_GetTicks(); // No need for AI anymore. p->ptimer = p->timer[0] + 1000 + (unsigned int)sqrt(10*p->armour_max*p->shield_max); p->timer[1] = p->timer[0]; // Explosion timer. + + // Flag cleanup - fixes some issues. + if(pilot_isFlag(p, PILOT_HYP_PREP)) pilot_rmFlag(p, PILOT_HYP_PREP); + if(pilot_isFlag(p, PILOT_HYP_BEGIN)) pilot_rmFlag(p, PILOT_HYP_BEGIN); + if(pilot_isFlag(p, PILOT_HYPERSPACE)) pilot_rmFlag(p, PILOT_HYPERSPACE); + + // Our pilot is now deadz. pilot_setFlag(p, PILOT_DEAD); }