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

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

[Wesnoth-cvs-commits] wesnoth/src playturn.cpp


From: Jon Daniel
Subject: [Wesnoth-cvs-commits] wesnoth/src playturn.cpp
Date: Fri, 21 Jan 2005 22:51:19 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jon Daniel <address@hidden>     05/01/22 03:51:19

Modified files:
        src            : playturn.cpp 

Log message:
        Fixed Bug #11613 which allowed units to be recruited
        with the repeat recruit hotkey even if they are not
        available anymore.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.318&tr2=1.319&r1=text&r2=text

Patches:
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.318 wesnoth/src/playturn.cpp:1.319
--- wesnoth/src/playturn.cpp:1.318      Fri Jan 21 20:07:30 2005
+++ wesnoth/src/playturn.cpp    Sat Jan 22 03:51:18 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.318 2005/01/21 20:07:30 Sirp Exp $ */
+/* $Id: playturn.cpp,v 1.319 2005/01/22 03:51:18 j_daniel Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1791,12 +1791,17 @@
 {
        team& current_team = teams_[team_num_-1];
 
+       //search for the unit to be recruited in recruits
        int recruit_num = 0;
        const std::set<std::string>& recruits = current_team.recruits();
-       for(std::set<std::string>::const_iterator r = recruits.begin(); r != 
recruits.end(); ++r) {
-               if(name == *r)
-                       break;
+       for(std::set<std::string>::const_iterator r = recruits.begin(); ; ++r) {
+               if (r == recruits.end()) {
+                       return;
+               }
 
+               if (name == *r) {
+                       break;
+               }
                ++recruit_num;
        }
 




reply via email to

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