CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Jon Daniel <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
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;
}