[Commits] [wesnoth/wesnoth] e24994: Restore unit bars after moving even if the animato...

GitHub noreply at github.com
Tue Jun 2 07:03:04 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: e249945b36212d3c01b29cf7658d8762620ca73f
      https://github.com/wesnoth/wesnoth/commit/e249945b36212d3c01b29cf7658d8762620ca73f
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M changelog
    M players_changelog
    M src/actions/move.cpp
    M src/unit_display.cpp

  Log Message:
  -----------
  Restore unit bars after moving even if the animator is disabled

This fixes an issue where unit bars disappeared for individual units
after a movement action with Quick Replays on or when using the Skip
Animations replay option, so that they'd only reappear after playing an
attack or select animation (or any other animation, probably).

The cause was that these options cause the replay code to hold a CVideo
lock, which causes the unit_display::unit_mover::finish() to return
early without restoring the animated unit's bars. Since this also makes
the u_d::unit_mover not hide the bars in the first place, it wouldn't
normally be an issue; the bug is actually caused by an interaction with
actions::unit_mover::do_move(), which unconditionally hides a unit's
bars for every movement step.

Since I don't want to call unit::set_standing() more times than
necessary (even though a::u_m::do_move() appears to do just that), I
decided to have u_d::u_m::finish() reset the unit's state even when
it's not supposed to do anything due to display locks.

I also added comments in a::u_m::do_move() and u_d::u_m::finish() to
warn people about this interaction in case it comes up again in the
future.





More information about the Commits mailing list