[Commits] [wesnoth/wesnoth] dd36c4: 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/1.12
  Home:   https://github.com/wesnoth/wesnoth
  Commit: dd36c4ed5ff611f479e2bb94359f1e9cd6e960d0
      https://github.com/wesnoth/wesnoth/commit/dd36c4ed5ff611f479e2bb94359f1e9cd6e960d0
  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