Author: crab
Date: Thu Apr 9 01:16:52 2009
New Revision: 34642
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34642&view=rev
Log:
Fixed an error with fallback to nearest_keep in the previous fix
Modified:
trunk/src/ai.hpp
trunk/src/ai_move.cpp
Modified: trunk/src/ai.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai.hpp?rev=34642&r1=34641&r2=34642&view=diff
==============================================================================
--- trunk/src/ai.hpp (original)
+++ trunk/src/ai.hpp Thu Apr 9 01:16:52 2009
@@ -351,7 +351,7 @@
/** Functions to deal with keeps. */
const std::set<location>& keeps();
const location& nearest_keep(const location& loc);
- /** get most suitable keep for leader - nearest free that can be
reached in 1 turn, if none - return nearest occupied that can be reached in 1
turn, if none - return null_location */
+ /** get most suitable keep for leader - nearest free that can be
reached in 1 turn, if none - return nearest occupied that can be reached in 1
turn, if none - return nearest keep, if none - return null_location */
const map_location& suitable_keep( const location& leader_location,
const paths& leader_paths );
int count_free_hexes_in_castle(const map_location& loc,
std::set<map_location>&);
Modified: trunk/src/ai_move.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_move.cpp?rev=34642&r1=34641&r2=34642&view=diff
==============================================================================
--- trunk/src/ai_move.cpp (original)
+++ trunk/src/ai_move.cpp Thu Apr 9 01:16:52 2009
@@ -898,11 +898,7 @@
return *best_occupied_keep; // if there is an occupied keep
reachable during current turn, return it
}
- if (*best_occupied_keep != map_location::null_location){
- return nearest_keep(leader_location); // return nearest keep
- }
-
- return map_location::null_location; // return dummy location
+ return nearest_keep(leader_location); // return nearest keep
}
void ai::move_leader_to_keep(const move_map& enemy_dstsrc)
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits