Address bug #12185: Cannot recruit more than 99 castle tiles away.

This commit is contained in:
Eric S. Raymond 2008-08-20 18:57:50 +00:00
parent 1dbe578582
commit f52b29f4c0

View File

@ -114,7 +114,10 @@ bool can_recruit_on(const gamemap& map, const gamemap::location& leader, const g
return false;
castle_cost_calculator calc(map);
const paths::route& rt = a_star_search(leader, loc, 100.0, &calc, map.w(), map.h());
// The limit computed in the third argument is more than enough for
// any convex castle on the map. Strictly speaking it could be
// reduced to sqrt(map.w()**2 + map.h()**2).
const paths::route& rt = a_star_search(leader, loc, map.w()+map.h(), &calc, map.w(), map.h());
if(rt.steps.empty())
return false;