Author: crab
Date: Sat Mar 28 03:26:13 2009
New Revision: 34200

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34200&view=rev
Log:
Fixed incorrect handling of poisoning attacks when suggesting best attack in 
user interface

Modified:
    trunk/changelog
    trunk/src/actions.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=34200&r1=34199&r2=34200&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sat Mar 28 03:26:13 2009
@@ -17,6 +17,9 @@
    * new translations: Icelandic
    * updated translations: British English, Catalan, Chinese (Simplified),
       German, Finnish, Hebrew, Italian, Russian, Slovak, Turkish
+ * AI:
+   * Fixed incorrect handling of poisoning attacks when suggesting best attack
+     in user interface
  * FormulaAI:
    * Fixed bug #13230: added debug_float FormulaAI function to allow debugging
      via floating popups on the specified hex

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=34200&r1=34199&r2=34200&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Sat Mar 28 03:26:13 2009
@@ -532,8 +532,8 @@
        double poison_b_us = (us_b.poisoned) * game_config::poison_amount;
        double poison_b_them = (them_b.poisoned) * game_config::poison_amount;
        // Compare: damage to them - damage to us (average_hp replaces -damage)
-       a = (us_a.average_hp()+poison_a_us)*harm_weight - 
(them_a.average_hp()+poison_a_them);
-       b = (us_b.average_hp()+poison_b_us)*harm_weight - 
(them_b.average_hp()+poison_b_them);
+       a = (us_a.average_hp()-poison_a_us)*harm_weight - 
(them_a.average_hp()-poison_a_them);
+       b = (us_b.average_hp()-poison_b_us)*harm_weight - 
(them_b.average_hp()-poison_b_them);
        if (a - b < -0.01)
                return false;
        if (a - b > 0.01)


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to