From b244db3b1837d2c4a7e823280b67b87bf4e56f48 Mon Sep 17 00:00:00 2001 From: David Mikos Date: Sun, 25 Jun 2017 13:45:17 +0930 Subject: [PATCH] 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. --- src/units/udisplay.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/units/udisplay.cpp b/src/units/udisplay.cpp index 2dfbea490095..5957b72715e3 100644 --- a/src/units/udisplay.cpp +++ b/src/units/udisplay.cpp @@ -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.