Partial fix bug #1565, unit movement artifacts

Returns code for unit_mover:wait_for_anims to
invalidate hexes on unit movements. This removes
artifacts being left on screen after large animated
units have moved.
This commit is contained in:
David Mikos 2017-06-25 13:45:17 +09:30
parent 68ae0d0f07
commit b244db3b18

View file

@ -394,6 +394,19 @@ void unit_mover::wait_for_anims()
animator_.wait_until(wait_until_);
// debug code, see unit_frame::redraw()
// std::cout << " end\n";
/// @todo For wesnoth 1.14+: check if efficient for redrawing?
/// Check with large animated units too make sure artifacts are
/// not left on screen after unit movement in particular.
if ( disp_ ) { // Should always be true if we get here.
// Invalidate the hexes around the move that prompted this wait.
map_location arr[6];
get_adjacent_tiles(path_[current_-1], arr);
for ( unsigned i = 0; i < 6; ++i )
disp_->invalidate(arr[i]);
get_adjacent_tiles(path_[current_], arr);
for ( unsigned i = 0; i < 6; ++i )
disp_->invalidate(arr[i]);
}
}
// Reset data.