Skip to content

Commit

Permalink
Partial fix bug #1565, unit movement artifacts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Coffee-- committed Jun 25, 2017
1 parent 68ae0d0 commit b244db3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/units/udisplay.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit b244db3

Please sign in to comment.