Author: crab
Date: Sat Mar 28 03:37:15 2009
New Revision: 34201

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34201&view=rev
Log:
backport r34200 from trun (Fixed incorrect handling of poisoning attacks when 
suggesting best attack in user interface)

Modified:
    branches/1.6/changelog
    branches/1.6/src/actions.cpp

Modified: branches/1.6/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/changelog?rev=34201&r1=34200&r2=34201&view=diff
==============================================================================
--- branches/1.6/changelog (original)
+++ branches/1.6/changelog Sat Mar 28 03:37:15 2009
@@ -10,6 +10,9 @@
      German, Finnish, Hebrew, Italian, Russian, Slovak, Turkish
  * General:
    * Fixed compilation with -D_GLIBCXX_PARALLEL
+ * AI:
+   * Fixed incorrect handling of poisoning attacks when suggesting best attack 
+     in user interface
 
 Version 1.6a:
  * User interface:

Modified: branches/1.6/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/actions.cpp?rev=34201&r1=34200&r2=34201&view=diff
==============================================================================
--- branches/1.6/src/actions.cpp (original)
+++ branches/1.6/src/actions.cpp Sat Mar 28 03:37:15 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