Use village_value instead of get_village_value()

No need to calculate the same value twice in a row, particularly when
the first calculation is already stored in a variable.
This commit is contained in:
J. Tyne 2013-02-21 17:25:32 +00:00
parent 367ce14be1
commit 6a235dc133

View File

@ -182,7 +182,7 @@ std::vector<target> default_ai_context_impl::find_targets(const move_map& enemy_
double corner_distance = distance_between(map_location(0,0), map_location(map_.w(),map_.h()));
double village_value = get_village_value();
if(has_leader && get_village_value() > 0.0) {
if(has_leader && village_value > 0.0) {
std::map<map_location,pathfind::paths> friends_possible_moves;
move_map friends_srcdst, friends_dstsrc;
calculate_possible_moves(friends_possible_moves, friends_srcdst, friends_dstsrc, false, true);