From dd7fafd1725694a1015704bfee40da0ad9b7311f Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Tue, 31 Jul 2012 20:52:30 +0200 Subject: Removed old warnings and documentation from chr_inv_change. This was forgotten to do when dropping the money checks and introducing the checkItem function. Reviewed-by: bjorn. --- src/scripting/lua.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/scripting') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index d3218a6..3368022 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -556,7 +556,7 @@ static int chr_get_equipment(lua_State *s) } /** - * chr_inv_change(Character*, (int id || string name, + * chr_inv_change(Character*, (int id || string name || itemclass item, * int nb)...): bool success * Callback for inserting/removing items in inventory. * The function can be called several times in a row, but it is better to @@ -564,10 +564,7 @@ static int chr_get_equipment(lua_State *s) * (negative amount) should be passed first, then insertions (positive amount). * If a removal fails, all the previous operations are canceled (except for * items dropped on the floor, hence why removals should be passed first), and - * the function returns false. Otherwise the function will return true. - * Note that previously when the item identifier was zero, money was modified; - * however currency is now handled through attributes. This breaks backwards - * compatibility with old scripts, and so logs a warning. + * the function returns false. * Note: If an insertion fails, extra items are dropped on the floor. */ static int chr_inv_change(lua_State *s) @@ -577,8 +574,7 @@ static int chr_inv_change(lua_State *s) Inventory inv(q); for (int i = 0; i < nb_items; ++i) { - if (!(lua_isnumber(s, i * 2 + 2) || lua_isstring(s, i * 2 + 2)) || - !lua_isnumber(s, i * 2 + 3)) + if (!lua_isnumber(s, i * 2 + 3)) { luaL_error(s, "chr_inv_change called with " "incorrect parameters."); -- cgit