Author: nephro
Date: Tue Apr  3 19:45:25 2012
New Revision: 53760

URL: http://svn.gna.org/viewcvs/wesnoth?rev=53760&view=rev
Log:
Fix: make the previous commit actually work

Modified:
    trunk/src/ai/lua/core.cpp

Modified: trunk/src/ai/lua/core.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/lua/core.cpp?rev=53760&r1=53759&r2=53760&view=diff
==============================================================================
--- trunk/src/ai/lua/core.cpp (original)
+++ trunk/src/ai/lua/core.cpp Tue Apr  3 19:45:25 2012
@@ -214,12 +214,12 @@
        int attacker_weapon = -1;//-1 means 'select what is best'
        double aggression = context.get_aggression();//use the aggression from 
the context
        
-       if (!lua_isnoneornil(L, index) &&  attacker_weapon != -1) {
-               attacker_weapon = lua_tointeger(L, index) - 1; // Done for 
consistency of the Lua style 
-       }
-
-       if (!lua_isnoneornil(L, index+1) && lua_isnumber(L,index+1)) {
-               aggression = lua_tonumber(L, index+1);
+       if (!lua_isnoneornil(L, index + 1) &&  attacker_weapon != -1) {
+               attacker_weapon = lua_tointeger(L, index + 1) - 1; // Done for 
consistency of the Lua style 
+       }
+
+       if (!lua_isnoneornil(L, index) && lua_isnumber(L,index)) {
+               aggression = lua_tonumber(L, index);
        }
 
        ai::attack_result_ptr attack_result = 
ai::actions::execute_attack_action(side,true,attacker,defender,attacker_weapon,aggression);


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

Reply via email to