wb: fix incorrect handling of skirmisher.

fixes #3014
This commit is contained in:
gfgtdf 2018-05-13 14:54:22 +02:00
parent 2e27f6ec81
commit 121361d302
2 changed files with 7 additions and 1 deletions

View file

@ -805,7 +805,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]));
}

View file

@ -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 "