[wesnoth-commits] [wesnoth/wesnoth] 79072b: fix OOS when undoing actions with synced choices

GitHub noreply at github.com
Tue Apr 3 23:43:51 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 79072b7c3d7ab662f1ca7bb27aa257bf9fd1a9fe
      https://github.com/wesnoth/wesnoth/commit/79072b7c3d7ab662f1ca7bb27aa257bf9fd1a9fe
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-04-04 (Wed, 04 Apr 2018)

  Changed paths:
    M src/playmp_controller.cpp
    M src/playturn.cpp
    M src/synced_context.cpp
    M src/synced_context.hpp

  Log Message:
  -----------
  fix OOS when undoing actions with synced choices

The problm was that the old code tried to use `undo_stack().can_undo()`
to check whether the current action can be undone. But
`undo_stack().can_undo()` uses the undo stack which is only updated at
the end of each action, so it cannot be used to check whether the action
that is currently executed can be undone.

This code removes some assertion that were wrong due to the
justmentioned.


  Commit: c4cf0c9da4b24589bd34a8aee9b41cda479ff35c
      https://github.com/wesnoth/wesnoth/commit/c4cf0c9da4b24589bd34a8aee9b41cda479ff35c
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-04-04 (Wed, 04 Apr 2018)

  Changed paths:
    M src/actions/attack.cpp
    M src/gui/dialogs/unit_attack.cpp

  Log Message:
  -----------
  fix filter not working in [disable] (#2826)

The problem was that the specials_context was not set during those
two get_special_bool calls

This removes what seems to be a rather useless optimisation in
battle_context::battle_context since choose_attacker_weapon would
just return 0 in that case.

fixes #2801


Compare: https://github.com/wesnoth/wesnoth/compare/596f3f1bda5e...c4cf0c9da4b2


More information about the Commits mailing list