mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 21:02:04 +00:00
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:
parent
367ce14be1
commit
6a235dc133
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user