diff --git a/src/pilot.c b/src/pilot.c index e78d2a5..83d4dec 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -282,6 +282,7 @@ void pilot_hit(Pilot* p, const Solid* w, const unsigned int shooter, } void pilot_dead(Pilot* p) { + if(pilot_isFlag(p, PILOT_DEAD)) return; // She's already dead. // Basically just set the timers.. if(p->id == PLAYER_ID) player_dead(); p->timer[0] = SDL_GetTicks(); // No need for AI anymore. diff --git a/src/player.c b/src/player.c index 2e32fb1..719957c 100644 --- a/src/player.c +++ b/src/player.c @@ -488,8 +488,7 @@ void player_render(void) { glColour* c; glFont* f; - if(player == NULL) return; - + // Pilot is dead, just render her and stop. if(player_isFlag(PLAYER_DESTROYED) || pilot_isFlag(player, PILOT_DEAD)) { if(player_isFlag(PLAYER_DESTROYED)) { if(!toolkit && (SDL_GetTicks() > player_timer)) @@ -503,6 +502,7 @@ void player_render(void) { return; } + if(player == NULL) return; // Render the player target graphics. if(player_target != PLAYER_ID) p = pilot_get(player_target); else p = NULL; @@ -1361,6 +1361,8 @@ void player_dead(void) { // Player blew up in a nice fireball. void player_destroyed(void) { + if(player_isFlag(PLAYER_DESTROYED)) return; + vectcpy(&player_cam, &player->solid->pos); gl_bindCamera(&player_cam); player_setFlag(PLAYER_DESTROYED);