summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-12-14 19:46:43 +0300
committerAndrei Karas <akaras@inbox.ru>2018-12-14 23:52:47 +0300
commitec05dccfddedf8250f1df61ce94dafb6823dace7 (patch)
tree8adadca7fb8eca7946bb598784a354a3519e79ae /src/map/script.c
parentc79927b6879f07784ceb19a606483acc791dea80 (diff)
downloadhercules-ec05dccfddedf8250f1df61ce94dafb6823dace7.tar.gz
hercules-ec05dccfddedf8250f1df61ce94dafb6823dace7.tar.bz2
hercules-ec05dccfddedf8250f1df61ce94dafb6823dace7.tar.xz
hercules-ec05dccfddedf8250f1df61ce94dafb6823dace7.zip
Add script command getInventorySize.
This command allow read current max inventory size.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 8dadf6d57..3d3fba867 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24894,6 +24894,16 @@ static BUILDIN(expandInventory)
return true;
}
+// return current player inventory size
+static BUILDIN(getInventorySize)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+ script_pushint(st, sd->status.inventorySize);
+ return true;
+}
+
/**
* Adds a built-in script function.
*
@@ -25637,6 +25647,7 @@ static void script_parse_builtin(void)
BUILDIN_DEF(expandInventoryAck, "i?"),
BUILDIN_DEF(expandInventoryResult, "i"),
BUILDIN_DEF(expandInventory, "i"),
+ BUILDIN_DEF(getInventorySize, ""),
};
int i, len = ARRAYLENGTH(BUILDIN);
RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up