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

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


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: ea257355018e8bc79bc2d7ad9b20840a270bd026
      https://github.com/wesnoth/wesnoth/commit/ea257355018e8bc79bc2d7ad9b20840a270bd026
  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