mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-12 16:49:18 +00:00
fix units with high mp beeing able to step over unreachable
This commit is contained in:
parent
ac063ce8e7
commit
59947ae969
@ -716,7 +716,7 @@ double shortest_path_calculator::cost(const map_location& loc, const double so_f
|
|||||||
remaining_movement = total_movement_ - (-remaining_movement) % total_movement_;
|
remaining_movement = total_movement_ - (-remaining_movement) % total_movement_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (total_movement_ < terrain_cost && remaining_movement < terrain_cost) {
|
if (terrain_cost >= movetype::UNREACHABLE || (total_movement_ < terrain_cost && remaining_movement < terrain_cost)) {
|
||||||
return getNoPathValue();
|
return getNoPathValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user