summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-11-12 02:01:05 +0100
committerHaru <haru@dotalux.com>2017-11-12 02:01:05 +0100
commite52cb33ab5f9900e9c10818a19b49c80c2196f76 (patch)
tree8f580cccd7acfebe13c17be56c8ea29003726ae7 /src
parentdfcb1ff37ad077249c0050bb1bab8994225191e1 (diff)
downloadhercules-e52cb33ab5f9900e9c10818a19b49c80c2196f76.tar.gz
hercules-e52cb33ab5f9900e9c10818a19b49c80c2196f76.tar.bz2
hercules-e52cb33ab5f9900e9c10818a19b49c80c2196f76.tar.xz
hercules-e52cb33ab5f9900e9c10818a19b49c80c2196f76.zip
Add ITEMINFO_VIEWSPRITE support to getiteminfo() / setiteminfo().
Adds the ability to query an item's view sprite, lost with #1828 Fixes #1895 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c7
-rw-r--r--src/map/script.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 133142625..68c4c7468 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14129,6 +14129,9 @@ BUILDIN(getiteminfo)
case ITEMINFO_MATK:
script_pushint(st, it->matk);
break;
+ case ITEMINFO_VIEWSPRITE:
+ script_pushint(st, it->view_sprite);
+ break;
default:
ShowError("buildin_getiteminfo: Invalid item type %d.\n", n);
script_pushint(st,-1);
@@ -14392,6 +14395,9 @@ BUILDIN(setiteminfo)
case ITEMINFO_MATK:
it->matk = value;
break;
+ case ITEMINFO_VIEWSPRITE:
+ it->view_sprite = value;
+ break;
default:
ShowError("buildin_setiteminfo: invalid type %d.\n", n);
script_pushint(st,-1);
@@ -24837,6 +24843,7 @@ void script_hardcoded_constants(void)
script->set_constant("ITEMINFO_WLV", ITEMINFO_WLV, false, false);
script->set_constant("ITEMINFO_VIEWID", ITEMINFO_VIEWID, false, false);
script->set_constant("ITEMINFO_MATK", ITEMINFO_MATK, false, false);
+ script->set_constant("ITEMINFO_VIEWSPRITE", ITEMINFO_VIEWSPRITE, false, false);
script->constdb_comment("Renewal");
#ifdef RENEWAL
diff --git a/src/map/script.h b/src/map/script.h
index f9d86007b..14d20838d 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -448,6 +448,7 @@ enum script_iteminfo_types {
ITEMINFO_WLV,
ITEMINFO_VIEWID,
ITEMINFO_MATK,
+ ITEMINFO_VIEWSPRITE,
ITEMINFO_MAX
};