[wesnoth-commits] [wesnoth/wesnoth] 00d854: Damage prediction: round very close slow probabili...

GitHub noreply at github.com
Fri Jul 6 19:55:32 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 00d8548c24a70365f1b02116e129c8835dff206a
      https://github.com/wesnoth/wesnoth/commit/00d8548c24a70365f1b02116e129c8835dff206a
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2018-07-06 (Fri, 06 Jul 2018)

  Changed paths:
    M src/attack_prediction.cpp

  Log Message:
  -----------
  Damage prediction: round very close slow probabilities to 0 or 1

In the case in bug #3321, damage prediction code somehow receives a
combatant whose probability to be slowed is very close to one of those
values but not quite it. I couldn't figure out how it's possible because
only damage prediction code itself is supposed to emit slow probabilities,
and it's not producing such a probability in this case.

Without more information, I'm simply fixing the bug by force. If the
probability is in the problematic area, we simply round it to 0 or 1. This
way such probabilities are impossible later on when we try to scale the HP
distributions so that they add to 1.

Fixes #3321.



      **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