wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src playcampaign.cpp playlevel.cpp


From: Jon Daniel
Subject: [Wesnoth-cvs-commits] wesnoth/src playcampaign.cpp playlevel.cpp
Date: Fri, 05 Aug 2005 10:11:47 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jon Daniel <address@hidden>     05/08/05 14:11:46

Modified files:
        src            : playcampaign.cpp playlevel.cpp 

Log message:
        Fix that the host has to click the dialogs away in order to send 
end_scenarios in case of a DEFEAT

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playcampaign.cpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playlevel.cpp.diff?tr1=1.211&tr2=1.212&r1=text&r2=text

Patches:
Index: wesnoth/src/playcampaign.cpp
diff -u wesnoth/src/playcampaign.cpp:1.10 wesnoth/src/playcampaign.cpp:1.11
--- wesnoth/src/playcampaign.cpp:1.10   Tue Aug  2 20:38:45 2005
+++ wesnoth/src/playcampaign.cpp        Fri Aug  5 14:11:46 2005
@@ -1,4 +1,4 @@
-/* $Id: playcampaign.cpp,v 1.10 2005/08/02 20:38:45 j_daniel Exp $ */
+/* $Id: playcampaign.cpp,v 1.11 2005/08/05 14:11:46 j_daniel Exp $ */
 /*
    Copyright (C) 2003-2005 by David White <address@hidden>
    Copyright (C) 2005 by Philippe Plantier <address@hidden>
@@ -134,7 +134,23 @@
                        LEVEL_RESULT res = 
play_level(units_data,game_config,scenario,video,state,story);
 
                        state.snapshot = config();
-
+                       if (res == DEFEAT) {
+                               // tell all clients that the campaign won't 
continue
+                               if(io_type == IO_SERVER) {
+                                       config end;
+                                       end.add_child("end_scenarios");
+                                       network::send_data(end);
+                               }
+                               gui::show_dialog(disp, NULL,
+                                                _("Defeat"),
+                                                _("You have been defeated!"),
+                                                gui::OK_ONLY);
+                       }
+                       if(res == QUIT && io_type == IO_SERVER) {
+                                       config end;
+                                       end.add_child("end_scenarios");
+                                       network::send_data(end);
+                       }
                        //ask to save a replay of the game
                        if(res == VICTORY || res == DEFEAT) {
                                const std::string orig_scenario = 
state.scenario;
@@ -175,15 +191,8 @@
                                res = VICTORY;
                                save_game_after_scenario = false;
                        }
-                       if(res != VICTORY) {
-                               // tell all clients that the campaign won't 
continue
-                               if(io_type == IO_SERVER) {
-                                       config end;
-                                       end.add_child("end_scenarios");
-                                       network::send_data(end);
-                               }
+                       if(res != VICTORY)
                                return res;
-                       }
                } catch(game::load_game_failed& e) {
                        gui::show_error_message(disp, _("The game could not be 
loaded: ") + e.message);
                        return QUIT;
Index: wesnoth/src/playlevel.cpp
diff -u wesnoth/src/playlevel.cpp:1.211 wesnoth/src/playlevel.cpp:1.212
--- wesnoth/src/playlevel.cpp:1.211     Sat Jul  2 21:37:19 2005
+++ wesnoth/src/playlevel.cpp   Fri Aug  5 14:11:46 2005
@@ -1,4 +1,4 @@
-/* $Id: playlevel.cpp,v 1.211 2005/07/02 21:37:19 ott Exp $ */
+/* $Id: playlevel.cpp,v 1.212 2005/08/05 14:11:46 j_daniel Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -767,11 +767,9 @@
                        }
 
                        if (!obs)
-                               gui::show_dialog(gui, NULL,
-                                                _("Defeat"),
-                                                _("You have been defeated!"),
-                                                gui::OK_ONLY);
-                       return DEFEAT;
+                               return DEFEAT;
+                       else
+                               return QUIT;
                } else if (end_level.result == VICTORY || end_level.result == 
LEVEL_CONTINUE ||
                           end_level.result == LEVEL_CONTINUE_NO_SAVE) {
                        try {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]