Restore coins when not using reset point, really
authorTim Goya <tuxdev103@gmail.com>
Mon, 29 Jan 2007 16:02:51 +0000 (16:02 +0000)
committerTim Goya <tuxdev103@gmail.com>
Mon, 29 Jan 2007 16:02:51 +0000 (16:02 +0000)
SVN-Revision: 4735

src/game_session.cpp

index ab1697f..84c1793 100644 (file)
@@ -138,6 +138,7 @@ GameSession::restart_level(bool fromBeginning)
     }
     currentsector->activate(reset_pos);
   } else {
+    player_status->coins += 25;
     currentsector = level->get_sector("main");
     if(!currentsector)
       throw std::runtime_error("Couldn't find main sector");
@@ -386,7 +387,6 @@ GameSession::check_end_conditions()
   } else if (!end_sequence && tux->is_dead()) {
     if (player_status->coins < 0) {
       // No more coins: restart level from beginning
-      player_status->coins += 25;
       restart_level(true);
     } else {
       // Still has coins: restart level from last reset point