Author: esr
Date: Thu Oct 23 03:43:37 2008
New Revision: 30322

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30322&view=rev
Log:
Cosmetic code cleanup from one of sukko's commits.  No game effects.

Modified:
    trunk/src/formula_ai.cpp

Modified: trunk/src/formula_ai.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/formula_ai.cpp?rev=30322&r1=30321&r2=30322&view=diff
==============================================================================
--- trunk/src/formula_ai.cpp (original)
+++ trunk/src/formula_ai.cpp Thu Oct 23 03:43:37 2008
@@ -1397,22 +1397,19 @@
 
        for(unit_map::unit_iterator i = units_.begin() ; i != units_.end() ; 
++i)
        {
-               if (i->second.side() == get_info().team_num)
+               if ( (i->second.side() == get_info().team_num) && 
i->second.has_formula() )
                {
-                       if( i->second.has_formula() )
-                       {
-                               try {
-                                       game_logic::const_formula_ptr 
formula(new game_logic::formula(i->second.get_formula(), &function_table));
-                                       game_logic::map_formula_callable 
callable(this);
-                                       callable.add_ref();
-                                       callable.add("me", variant(new 
unit_callable(*i)));
-                                       make_move(formula, callable);
-                               }
-                               catch(formula_error& e) {
-                                       if(e.filename_ == "formula")
-                                               e.line_ = 0;
-                                       handle_exception( e, "Unit formula 
error for unit: '" + i->second.type_id() + "' standing at (" + 
boost::lexical_cast<std::string>(i->first.x+1) + "," + 
boost::lexical_cast<std::string>(i->first.y+1) + ")");
-                               }
+                       try {
+                               game_logic::const_formula_ptr formula(new 
game_logic::formula(i->second.get_formula(), &function_table));
+                               game_logic::map_formula_callable callable(this);
+                               callable.add_ref();
+                               callable.add("me", variant(new 
unit_callable(*i)));
+                               make_move(formula, callable);
+                       }
+                       catch(formula_error& e) {
+                               if(e.filename_ == "formula")
+                                       e.line_ = 0;
+                               handle_exception( e, "Unit formula error for 
unit: '" + i->second.type_id() + "' standing at (" + 
boost::lexical_cast<std::string>(i->first.x+1) + "," + 
boost::lexical_cast<std::string>(i->first.y+1) + ")");
                        }
 
                        if( i->second.has_loop_formula() )


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

Reply via email to