[wesnoth-commits] [wesnoth/wesnoth] e4cbfa: Remove code from replay_controller that's already ...

Steve Cotton noreply at github.com
Sun Jul 28 18:46:21 UTC 2019


  Branch: refs/heads/1.14
  Home:   https://github.com/wesnoth/wesnoth
  Commit: e4cbfa28a98b4a5d406e85cb90dd3878010a737b
      https://github.com/wesnoth/wesnoth/commit/e4cbfa28a98b4a5d406e85cb90dd3878010a737b
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2019-07-28 (Sun, 28 Jul 2019)

  Changed paths:
    M src/replay_controller.cpp
    M src/replay_controller.hpp

  Log Message:
  -----------
  Remove code from replay_controller that's already handled by the hotkey system

Fixes a crash when playing a replay that includes a theme, when that theme doesn't
have all of the buttons that the removed code expected. For example, this replay
from SXRPG 5.2.3 has two replay themes, of which one lacks button-nextmove:
* https://replays.wesnoth.org/1.14/20190701/SXRPG_TempleOfBones_Turn_8_(53897).bz2

All of the button::enable() calls were unnecessary logic, because the hotkey
system will query replay_controller::can_execute_command() and enable or
disable the buttons to match. However, the enable() calls appear to have had
the side-effect of triggering the hotkey system to check the buttons' required
states and redraw.

The code in build_replay_theme() was unreachable, because replay_controller
doesn't attach itself to the completely_redrawn event.





More information about the Commits mailing list