From 760051fac75395d00342bd573121c9b0ba31b952 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Thu, 3 Jan 2008 16:41:36 +0000 Subject: [PATCH] Reset play_time when level is restarted SVN-Revision: 5245 --- src/game_session.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); } -- 2.11.0