From 3ff2885fd24c0a2a11bbaadfb7ec73a3b6370dfe Mon Sep 17 00:00:00 2001 From: Allanis Date: Sat, 1 Jun 2013 18:11:56 +0100 Subject: [PATCH] [Fix] Annoying ass bug with overwriting a pilot that is dead!! --- src/player.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/player.c b/src/player.c index a04fe57..3e5a650 100644 --- a/src/player.c +++ b/src/player.c @@ -256,7 +256,6 @@ static void player_newMake(void) { // Create the player and start the game. player_newShip(ship, x, y, 0., 0., RNG(0, 359)/180.*M_PI); space_init(system); - map_clear(); // Set the map up. // Clear the map. map_clear(); @@ -493,8 +492,9 @@ void player_render(void) { // 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)) + if(!toolkit && (player != NULL) && (SDL_GetTicks() > player_timer)) { menu_death(); + } } else pilot_render(player); @@ -1528,6 +1528,7 @@ int player_load(xmlNodePtr parent) { xmlNodePtr node; // Some cleanup. + player_flags = 0; player_cleanup(); var_cleanup(); missions_cleanup();