Author: esr
Date: Thu Oct 23 01:15:03 2008
New Revision: 30318

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30318&view=rev
Log:
Minor improvements in attack target selection, from sukko's r29531
(peviiously reverted as emergency fix).

Modified:
    trunk/src/ai_move.cpp

Modified: trunk/src/ai_move.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_move.cpp?rev=30318&r1=30317&r2=30318&view=diff
==============================================================================
--- trunk/src/ai_move.cpp (original)
+++ trunk/src/ai_move.cpp Thu Oct 23 01:15:03 2008
@@ -714,6 +714,7 @@
                                if(*j != best_loc && 
distance_between(*j,best_loc) < 3) {
                                        LOG_AI << "found mass-to-attack 
target... " << *j << " with value: " << value*4.0 << "\n";
                                        
targets.push_back(target(*j,value*4.0,target::MASS));
+                                       best_target = targets.end() - 1;
                                }
                        }
 
@@ -772,6 +773,7 @@
                //this sounds like the road ahead might be dangerous, and 
that's why we don't advance.
                //create this as a target, attempting to rally units around
                targets.push_back(target(best->first,best_target->value));
+               best_target = targets.end() - 1;
                return std::pair<location,location>(best->first,best->first);
        }
 
@@ -860,7 +862,7 @@
                        }
 
 
-                       // The leader can't move to his keep, try to move to 
the closest map_location
+                       // The leader can't move to his keep, try to move to 
the closest location
                        // to the keep where there are no enemies in range.
                        for(std::set<map_location>::iterator i = 
keeps().begin();
                                        i != keeps().end(); ++i) {


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

Reply via email to