Author: grzywacz
Date: Wed Apr 18 17:02:16 2007
New Revision: 16900

URL: http://svn.gna.org/viewcvs/wesnoth?rev=16900&view=rev
Log:
Make campaigns playable again (don't quit after first scenario).

Modified:
    branches/gp2x/src/playsingle_controller.cpp

Modified: branches/gp2x/src/playsingle_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/gp2x/src/playsingle_controller.cpp?rev=16900&r1=16899&r2=16900&view=diff
==============================================================================
--- branches/gp2x/src/playsingle_controller.cpp (original)
+++ branches/gp2x/src/playsingle_controller.cpp Wed Apr 18 17:02:16 2007
@@ -186,14 +186,8 @@
                } //end for loop
 
        } catch(end_level_exception& end_level) {
-               bool obs = team_manager_.is_observer();
                if (game_config::exit_at_end) {
                        exit(0);
-               }
-               if (end_level.result == DEFEAT || end_level.result == VICTORY) {
-                       gui::show_dialog(*gui_, NULL, _("Game Over"),
-                                        _("The game is over."), gui::OK_ONLY);
-                       return QUIT;
                }
 
                if(end_level.result == QUIT) {
@@ -201,13 +195,10 @@
                } else if(end_level.result == DEFEAT) {
                        try {
                                game_events::fire("defeat");
-                       } catch(end_level_exception&) {
-                       }
-
-                       if (!obs)
-                               return DEFEAT;
-                       else
-                               return QUIT;
+                       } catch(end_level_exception&) { }
+
+                       return DEFEAT;
+
                } else if (end_level.result == VICTORY || end_level.result == 
LEVEL_CONTINUE ||
                           end_level.result == LEVEL_CONTINUE_NO_SAVE) {
                        try {
@@ -220,8 +211,7 @@
                                gamestate_.scenario = (level_)["next_scenario"];
                        }
 
-                       const bool has_next_scenario = 
!gamestate_.scenario.empty() &&
-                                                                               
        gamestate_.scenario != "null";
+                       const bool has_next_scenario = 
!gamestate_.scenario.empty() && gamestate_.scenario != "null";
 
                        //save current_player name to reuse it when setting 
next_scenario side info
                        std::vector<team>::iterator i;
@@ -303,9 +293,7 @@
                                }
                        }
 
-                       if (!obs)
-                               gui::show_dialog(*gui_, NULL, _("Victory"),
-                                                _("You have emerged 
victorious!"), gui::OK_ONLY);
+                       gui::show_dialog(*gui_, NULL, _("Victory"), _("You have 
emerged victorious!"), gui::OK_ONLY);
 
                        if (gamestate_.players.size() > 0 && has_next_scenario 
||
                                        gamestate_.campaign_type == "test")
@@ -313,7 +301,9 @@
 
                        return VICTORY;
                }
+
                image::flush_cache();
+
        } //end catch
        catch(replay::error&) {
                gui::show_dialog(*gui_,NULL,"",_("The file you have tried to 
load is corrupt"),


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to