parent
6a9e2c260d
commit
eaabf1648d
2 changed files with 7 additions and 1 deletions
|
@ -796,7 +796,9 @@ void manager::save_temp_move()
|
|||
//either switch over to a plain route for planned moves, or mark it correctly
|
||||
pathfind::marked_route route;
|
||||
route.steps = move_arrow->get_path();
|
||||
route.move_cost = path_cost(route.steps,*u);
|
||||
// path_cost() is incomplete as it for example doesn't handle skirmisher, we let the move action generate the costs on it own.
|
||||
// route.move_cost = path_cost(route.steps,*u);
|
||||
route.move_cost = -1;
|
||||
|
||||
sa.queue_move(turn, *u, route, move_arrow, std::move(fake_units_[i]));
|
||||
}
|
||||
|
|
|
@ -352,6 +352,10 @@ void move::apply_temp_modifier(unit_map& unit_map)
|
|||
unit = &*unit_it;
|
||||
}
|
||||
|
||||
if (route_->move_cost == -1) {
|
||||
// TODO: check_validity also calls pathfind::mark_route(get_route().route), optimize/refactor this to only call that once.
|
||||
route_->move_cost = pathfind::mark_route(get_route().route).move_cost;
|
||||
}
|
||||
//Modify movement points
|
||||
DBG_WB <<"Move: Changing movement points for unit " << unit->name() << " [" << unit->id()
|
||||
<< "] from " << unit->movement_left() << " to "
|
||||
|
|
Loading…
Add table
Reference in a new issue