mail[Wesnoth-commits] r33439 - in /trunk: changelog src/ai_move.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by shadowm2006 on March 08, 2009 - 17:47:
Author: shadowmaster
Date: Sun Mar  8 17:47:39 2009
New Revision: 33439

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33439&view=rev
Log:
Per esr's 33435, add a changelog note and deprecation messages stating
that support for scout_village_targetting and simple_targetting [sic]
will be removed in 1.7.0. The message will be hidden for 1.6.0.

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

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33439&r1=33438&r2=33439&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Mar  8 17:47:39 2009
@@ -12,6 +12,10 @@
    * Fix bug #13118: OOS/replay bug when moving near ambushed units
    * Better fog update after "slow" and "stone" attacks
    * Updated Doxyfile to 1.5.6 format
+   * Renamed some [ai] attributes to use correct English spelling.
+     Support for their misspelled forms will be removed in 1.7.0.
+     * simple_targetting -> simple_targetting
+     * scout_village_targetting -> scout_village_targeting
 
 Version 1.5.12:
  * Add-on server:

Modified: trunk/src/ai_move.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_move.cpp?rev=33439&r1=33438&r2=33439&view=diff
==============================================================================
--- trunk/src/ai_move.cpp (original)
+++ trunk/src/ai_move.cpp Sun Mar  8 17:47:39 2009
@@ -523,7 +523,13 @@
 
                        //scouts also get a bonus for going after villages
                        if(tg->type == target::VILLAGE) {
-                               rating *= 
lexical_cast_default<int>(current_team().ai_parameters()["scout_village_targeting"],3);
+                               
if(current_team().ai_parameters().has_attribute("scout_village_targetting")) {
+                                       rating *= 
lexical_cast_default<int>(current_team().ai_parameters()["scout_village_targetting"],3);
+                                       lg::wml_error << "[ai] the 
'scout_village_targetting' attribute is deprecated, support will be removed 
in version 1.7.0; use 'scout_village_targetting' instead\n";
+                               }
+                               else {
+                                       rating *= 
lexical_cast_default<int>(current_team().ai_parameters()["scout_village_targeting"],3);
+                               }
                        }
                }
 
@@ -551,7 +557,15 @@
        //if we have the 'simple_targeting' flag set, then we don't
        //see if any other units can put a better bid forward for this
        //target
-       const bool dumb_ai = 
utils::string_bool(current_team().ai_parameters()["simple_targeting"]);
+       bool simple_targeting = false;
+       if(current_team().ai_parameters().has_attribute("simple_targetting")) 
{
+               simple_targeting = 
utils::string_bool(current_team().ai_parameters()["simple_targetting"]);
+               lg::wml_error << "[ai] the 'simple_targetting' attribute is 
deprecated, support will be removed in version 1.7.0; use 'simple_targeting' 
instead\n";
+       }
+       else {
+               simple_targeting = 
utils::string_bool(current_team().ai_parameters()["simple_targeting"]);
+       }
+       const bool& dumb_ai = simple_targeting;
 
        if(dumb_ai == false) {
                LOG_AI << "complex targeting...\n";




Related Messages


Powered by MHonArc, Updated Sun Mar 08 18:00:28 2009