[wesnoth-commits] [wesnoth/wesnoth] 5f58cd: Unit Attack: fixed issues arising from displayed i...

GitHub noreply at github.com
Fri Jun 8 16:32:56 UTC 2018


  Branch: refs/heads/1.14
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 5f58cd7c6d39c35dcefa6fb9f71777a42ea5cb5e
      https://github.com/wesnoth/wesnoth/commit/5f58cd7c6d39c35dcefa6fb9f71777a42ea5cb5e
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-06-09 (Sat, 09 Jun 2018)

  Changed paths:
    M changelog.md
    M src/gui/dialogs/unit_attack.cpp
    M src/mouse_events.cpp

  Log Message:
  -----------
  Unit Attack: fixed issues arising from displayed items potentially not equally available items

Since there were weapons included that weren't shown, it was possible for the best
weapon selection to be a hidden one (in which case, the initial selection would be
wrong, and it was possible for the returned index to point to a hidden, disabled
weapon.

This resolves both issues by excluding these disabled attacks from the weapon choices
list altogether. They aren't considered when calculating the best attack either.

mouse_handler::fill_weapon_choices is also used in mouse_handler::attack_enemy_, but
I don't foresee this change should cause any issues there, since you aren't supposed
to be able to actually attack with disabled weapons anyway.



      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the Commits mailing list