summaryrefslogtreecommitdiffstats
path: root/src/scripting
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-07-31 20:52:30 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-08-05 23:22:23 +0200
commitdd7fafd1725694a1015704bfee40da0ad9b7311f (patch)
tree0cf695b4be2f4b81b1df8cb4d1f8066244c43405 /src/scripting
parent05f3249e17121dc79e447b878cbd54e4d51dcdef (diff)
downloadmanaserv-dd7fafd1725694a1015704bfee40da0ad9b7311f.tar.gz
manaserv-dd7fafd1725694a1015704bfee40da0ad9b7311f.tar.xz
manaserv-dd7fafd1725694a1015704bfee40da0ad9b7311f.zip
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.
Diffstat (limited to 'src/scripting')
-rw-r--r--src/scripting/lua.cpp10
1 files changed, 3 insertions, 7 deletions
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.");