Author: nephro
Date: Tue Apr 3 19:11:56 2012
New Revision: 53759
URL: http://svn.gna.org/viewcvs/wesnoth?rev=53759&view=rev
Log:
LuaAI context: swapped arguments for the ai.attack() function, to correspond to
the wiki definition
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=53759&r1=53758&r2=53759&view=diff
==============================================================================
--- trunk/src/ai/lua/core.cpp (original)
+++ trunk/src/ai/lua/core.cpp Tue Apr 3 19:11:56 2012
@@ -213,13 +213,13 @@
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) && attacker_weapon != -1) {
- attacker_weapon = lua_tointeger(L, index) - 1; // Done for
consistency of the Lua style
}
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