Author: suokko
Date: Thu Sep 18 22:43:41 2008
New Revision: 29540

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29540&view=rev
Log:
Fix wrong type for leadership bonus and fix a ai debug messange to DBG instead 
of ERR

Modified:
    trunk/src/ai_attack.cpp
    trunk/src/ai_move.cpp

Modified: trunk/src/ai_attack.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_attack.cpp?rev=29540&r1=29539&r2=29540&view=diff
==============================================================================
--- trunk/src/ai_attack.cpp (original)
+++ trunk/src/ai_attack.cpp Thu Sep 18 22:43:41 2008
@@ -186,9 +186,8 @@
                        }
 
                    unit_ability_list abil = 
unit_itor->second.get_abilities("leadership",tiles[j]);
-                   int best_leadership_bonus = abil.highest("value").first;
-                       double leadership_bonus = 
static_cast<double>(best_leadership_bonus+100)/100.0;
-                       if (leadership_bonus > 1.1) {
+                   int leadership_bonus = abil.highest("value").first + 100;
+                       if (leadership_bonus > 100) {
                                ERR_AI << unit_itor->second.name() << " is 
getting leadership " << leadership_bonus << "\n";
                        }
 
@@ -222,7 +221,7 @@
                        }
 
                        // See if this position is the best rated we've seen so 
far.
-                       int rating = rate_terrain(unit_itor->second,tiles[j]) * 
backstab_bonus * leadership_bonus;
+                       int rating = rate_terrain(unit_itor->second,tiles[j]) * 
backstab_bonus * leadership_bonus / 100;
                        if(cur_position >= 0 && rating < best_rating) {
                                continue;
                        }

Modified: trunk/src/ai_move.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_move.cpp?rev=29540&r1=29539&r2=29540&view=diff
==============================================================================
--- trunk/src/ai_move.cpp (original)
+++ trunk/src/ai_move.cpp Thu Sep 18 22:43:41 2008
@@ -160,7 +160,7 @@
                        if(get_village) {
                                double value = current_team().village_value();
                                value *= 1.0 - 
static_cast<double>(distance_between(*t,leader->first))/corner_distance;
-                               ERR_AI << "found village target... " << *t << " 
with value: " << value << " distance: " << 
static_cast<double>(distance_between(*t,leader->first)) << "\n";
+                               DBG_AI << "found village target... " << *t << " 
with value: " << value << " distance: " << 
static_cast<double>(distance_between(*t,leader->first)) << "\n";
                                
targets.push_back(target(*t,value,target::VILLAGE));
                        }
                }


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

Reply via email to