From: Christoph Sommer Date: Thu, 3 Jan 2008 16:41:36 +0000 (+0000) Subject: Reset play_time when level is restarted X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=760051fac75395d00342bd573121c9b0ba31b952;p=supertux.git Reset play_time when level is restarted SVN-Revision: 5245 --- diff --git a/src/game_session.cpp b/src/game_session.cpp index ee036eb18..a0e48c394 100644 --- a/src/game_session.cpp +++ b/src/game_session.cpp @@ -135,7 +135,6 @@ GameSession::restart_level() level->stats.total_badguys = level->get_total_badguys(); level->stats.total_secrets = level->get_total_count(); level->stats.reset(); - if(reset_sector != "")level->stats.declare_invalid(); if(reset_sector != "") { currentsector = level->get_sector(reset_sector); @@ -144,11 +143,13 @@ GameSession::restart_level() msg << "Couldn't find sector '" << reset_sector << "' for resetting tux."; throw std::runtime_error(msg.str()); } + level->stats.declare_invalid(); currentsector->activate(reset_pos); } else { currentsector = level->get_sector("main"); if(!currentsector) throw std::runtime_error("Couldn't find main sector"); + play_time = 0; currentsector->activate("main"); }