[wesnoth-commits] [wesnoth/wesnoth] 494b2f: Fix #2608: possible crash after Monte Carlo simula...

GitHub noreply at github.com
Wed Mar 7 20:16:54 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 494b2f35ca58d2ccd3106724a86267ca666e6805
      https://github.com/wesnoth/wesnoth/commit/494b2f35ca58d2ccd3106724a86267ca666e6805
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2018-03-07 (Wed, 07 Mar 2018)

  Changed paths:
    M src/attack_prediction.cpp

  Log Message:
  -----------
  Fix #2608: possible crash after Monte Carlo simulation for slowed unit

Due to rounding error, if the unit was already slowed, it was possible for
the code that calculates the probability to be slowed to arrive at a bit
above 100%. If the AI later simulated another fight for the same unit, it
triggered the assertion that the probability wasn't in allowed range.

Fixed by limiting the probability to 100%.




More information about the Commits mailing list