Author: suokko
Date: Wed Sep 17 12:01:20 2008
New Revision: 29513
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29513&view=rev
Log:
Fixed distance calculation to keep in move_leader_to_keep
Modified:
trunk/src/ai_move.cpp
Modified: trunk/src/ai_move.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_move.cpp?rev=29513&r1=29512&r2=29513&view=diff
==============================================================================
--- trunk/src/ai_move.cpp (original)
+++ trunk/src/ai_move.cpp Wed Sep 17 12:01:20 2008
@@ -845,8 +845,8 @@
std::set<gamemap::location> checked_hexes;
checked_hexes.insert(*i);
const int free_slots =
count_free_hexes_in_castle(*i, checked_hexes);
- const int tactical_value =
std::sqrt(std::pow(static_cast<float>(map_.w()/2 - i->x),2) +
-
std::pow(static_cast<float>(map_.h()/2 - i->y),2))*2;
+ gamemap::location center(map_.w()/2,
map_.h()/2);
+ const int tactical_value =
distance_between(center, *i);
const int empty_slots =
leader->second.total_movement() * std::max(number_of_recruit - free_slots,0);
unit_map::const_iterator u = units_.find(*i);
const int reserved_penalty =
leader->second.total_movement() *
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits