summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-10-18 00:42:51 +0300
committerAndrei Karas <akaras@inbox.ru>2018-10-22 01:44:46 +0300
commitcf24c2af665191a9ae397ddf58badb1638a8a5bd (patch)
tree39d5730c970f64368898642e335e17492d31dc09 /src
parent0f2757e098043922dd1d87bf8133ee3426097f61 (diff)
downloadhercules-cf24c2af665191a9ae397ddf58badb1638a8a5bd.tar.gz
hercules-cf24c2af665191a9ae397ddf58badb1638a8a5bd.tar.bz2
hercules-cf24c2af665191a9ae397ddf58badb1638a8a5bd.tar.xz
hercules-cf24c2af665191a9ae397ddf58badb1638a8a5bd.zip
Add script command itempreview for update preview window with given item.
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 212c11687..e7a2fdb14 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24816,6 +24816,16 @@ static BUILDIN(changecamera)
return true;
}
+// update preview window to given item
+static BUILDIN(itempreview)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+ clif->item_preview(sd, script_getnum(st, 2));
+ return true;
+}
+
/**
* Adds a built-in script function.
*
@@ -25550,6 +25560,8 @@ static void script_parse_builtin(void)
// camera
BUILDIN_DEF(camerainfo, ""),
BUILDIN_DEF(changecamera, "iii?"),
+
+ BUILDIN_DEF(itempreview, "i"),
};
int i, len = ARRAYLENGTH(BUILDIN);
RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up