mail[Wesnoth-commits] r44318 - /trunk/src/scripting/lua.cpp


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

Header


Content

Posted by guillaume . melquiond on July 18, 2010 - 23:38:
Author: silene
Date: Sun Jul 18 23:38:41 2010
New Revision: 44318

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44318&view=rev
Log:
Cleaned code.

Modified:
    trunk/src/scripting/lua.cpp

Modified: trunk/src/scripting/lua.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/scripting/lua.cpp?rev=44318&r1=44317&r2=44318&view=diff
==============================================================================
--- trunk/src/scripting/lua.cpp (original)
+++ trunk/src/scripting/lua.cpp Sun Jul 18 23:38:41 2010
@@ -1253,23 +1253,18 @@
 }
 
 /**
- * Gets 2 parameters
- * - Arg 1: side number of the first team
- * - Arg 2: side number of the second team
- * - Ret 1: true, if these two teams are enemies
- */
-
-static int intf_is_enemy(lua_State *L){
-
-        size_t side_1 = luaL_checkint(L, 1)-1;
-        size_t side_2 = luaL_checkint(L, 2)-1;
-        std::vector<team> &teams = *resources::teams;
-
-        if( side_1 >= teams.size() || side_2 >= teams.size()){
-                return 0;
-        }
-        lua_pushboolean(L, teams[side_1].is_enemy(side_2));
-        return 1;
+ * Returns whether the first side is an enemy of the second one.
+ * - Args 1,2: side numbers.
+ * - Ret 1: bool.
+ */
+static int intf_is_enemy(lua_State *L)
+{
+       unsigned side_1 = luaL_checkint(L, 1) - 1;
+       unsigned side_2 = luaL_checkint(L, 2) - 1;
+       std::vector<team> &teams = *resources::teams;
+       if (side_1 >= teams.size() || side_2 >= teams.size()) return 0;
+       lua_pushboolean(L, teams[side_1].is_enemy(side_2));
+       return 1;
 }
 
 /**




Related Messages


Powered by MHonArc, Updated Sun Jul 18 23:40:11 2010