[Commits] [wesnoth/wesnoth] 265e41: Damage calculation dialog: use existing battle pre...

GitHub noreply at github.com
Fri Aug 12 19:07:11 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 265e41dbdad3ece6ae45374dcf2174bdc0f385cc
      https://github.com/wesnoth/wesnoth/commit/265e41dbdad3ece6ae45374dcf2174bdc0f385cc
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-08-12 (Fri, 12 Aug 2016)

  Changed paths:
    M src/attack_prediction_display.cpp
    M src/attack_prediction_display.hpp
    M src/mouse_events.cpp

  Log Message:
  -----------
  Damage calculation dialog: use existing battle prediction

The game already predicts the outcome of all possible battles when the
player opens the unit attack dialog, for the purpose of choosing the best
weapon to attack. Simply use that data in the damage calculation dialog
instead of recalculating it.

The change in mouse_handler::fill_weapon_choices() ensures that the damage
prediction will be present for all weapons. If bc is first copied to the
vector and bc::better_attack() is called only after that, the copy of bc in
the vector will never receive the damage prediction result.





More information about the Commits mailing list