Check ZoC after clearing fog and execute sighted event.
This was already when revealing ambushed units was doing. It can possibly have an impact on sighted event creating units around the moving one (now directly stopped, not at the next step) Also cleaner for cases when me manage to move into fog. Finish to fix bug #10273: now teleporting into a fogged ZoC end your move.
This commit is contained in:
parent
a8f2583432
commit
5c881e74c2
1 changed files with 5 additions and 5 deletions
|
@ -1891,7 +1891,6 @@ size_t move_unit(game_display* disp, const game_data& gamedata,
|
|||
const t_translation::t_letter terrain = map[*step];
|
||||
|
||||
const unit_map::const_iterator enemy_unit = units.find(*step);
|
||||
const bool skirmisher = ui->second.get_ability_bool("skirmisher",*step);
|
||||
|
||||
const int mv = ui->second.movement_cost(terrain);
|
||||
if(discovered_unit || continue_move == false && seen_units.empty() == false ||
|
||||
|
@ -1901,10 +1900,6 @@ size_t move_unit(game_display* disp, const game_data& gamedata,
|
|||
moves_left -= mv;
|
||||
}
|
||||
|
||||
if(!skirmisher && enemy_zoc(map,units,teams,*step,team,ui->second.side())) {
|
||||
moves_left = 0;
|
||||
}
|
||||
|
||||
// If we use fog or shroud, see if we have sighted an enemy unit,
|
||||
// in which case we should stop immediately.
|
||||
// Cannot use check shroud, because also need to check if delay shroud is on.
|
||||
|
@ -1947,6 +1942,11 @@ size_t move_unit(game_display* disp, const game_data& gamedata,
|
|||
return (step - route.begin());
|
||||
}
|
||||
|
||||
const bool skirmisher = ui->second.get_ability_bool("skirmisher",*step);
|
||||
if(!skirmisher && enemy_zoc(map,units,teams,*step,team,ui->second.side())) {
|
||||
moves_left = 0;
|
||||
}
|
||||
|
||||
// Check if we have discovered an invisible enemy unit
|
||||
gamemap::location adjacent[6];
|
||||
get_adjacent_tiles(*step,adjacent);
|
||||
|
|
Loading…
Add table
Reference in a new issue