Fix bug #21257: make skip AI mid-movement animations invisible and only enable at end.

This commit is contained in:
David Mikos 2014-03-23 18:11:29 +10:30
parent a47ea57ae2
commit 0f7051b5f3
2 changed files with 15 additions and 2 deletions

View file

@ -46,6 +46,7 @@ Version 1.11.11+dev:
menu actions. An actual fix of the bug requires refactoring of the
animation code which will happen in Wesnoth 1.13.
* OS X user data directory is now ~/Library/Application Support/Wesnoth_1.12
* Fix bug #21257: Lagging animations with skip AI animations and fog/shroud.
Version 1.11.11:
* Add-ons server:

View file

@ -308,10 +308,17 @@ void unit_mover::start(unit& u)
*/
void unit_mover::proceed_to(unit& u, size_t path_index, bool update, bool wait)
{
// Nothing to do here if animations can/should not be shown.
if ( !can_draw_ || !animate_ )
// Nothing to do here if animations cannot be shown.
if ( !can_draw_ )
return;
// If no animation then hide unit until end of movement
if (!animate_)
{
u.set_hidden(true);
return;
}
// Handle pending visibility issues before introducing new ones.
wait_for_anims();
@ -454,6 +461,11 @@ void unit_mover::finish(unit &u, map_location::DIRECTION dir)
mousehandler->invalidate_reachmap();
}
}
else
{
// Show the unit at end of skipped animation
u.set_hidden(was_hidden_);
}
// Facing gets set even when not animating.
u.set_facing(dir == map_location::NDIRECTIONS ? final_dir : dir);