summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-14 21:16:48 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-25 01:43:47 +0300
commitff04f6ba4d732c16cc058a73d5e7a775da6b74d5 (patch)
treeebfe611962462c67b8acea7be5e5a08c8310ebce /src/map/pc.c
parente165af7fb85e58684e43c444ca9b086fe159432a (diff)
downloadhercules-ff04f6ba4d732c16cc058a73d5e7a775da6b74d5.tar.gz
hercules-ff04f6ba4d732c16cc058a73d5e7a775da6b74d5.tar.bz2
hercules-ff04f6ba4d732c16cc058a73d5e7a775da6b74d5.tar.xz
hercules-ff04f6ba4d732c16cc058a73d5e7a775da6b74d5.zip
Fix vending list packet for 2016 clients. Based on rathena commit:
commit 9716233c842f731df3fed5281370e324b5f5f024 Author: Lemongrass3110 <lemongrass@kstp.at> Date: Mon May 8 23:40:05 2017 +0200 Introducing the equip preview window Fixes some bugs for 2016-09-21 onward, where you can preview how a item would like if you put it on. This works on other people's vending and on your own inventory. Thanks to @Rytech2 and @hazimjauhari90
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 2303a83ca..c52da3c14 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -750,6 +750,7 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo
return 0;
}
+// [4144] probably pc_equippoint should be replaced to pc_item_equippoint
int pc_equippoint(struct map_session_data *sd,int n)
{
int ep = 0;
@@ -782,6 +783,33 @@ int pc_equippoint(struct map_session_data *sd,int n)
return ep;
}
+int pc_item_equippoint(struct map_session_data *sd, struct item_data* id)
+{
+ int ep = 0;
+
+ nullpo_ret(sd);
+ nullpo_ret(id);
+
+ if (!itemdb->isequip2(id))
+ return 0; //Not equippable by players.
+
+ ep = id->equip;
+ if (id->look == W_DAGGER ||
+ id->look == W_1HSWORD ||
+ id->look == W_1HAXE) {
+ if (pc->checkskill(sd, AS_LEFT) > 0 ||
+ (sd->job & MAPID_UPPERMASK) == MAPID_ASSASSIN ||
+ (sd->job & MAPID_UPPERMASK) == MAPID_KAGEROUOBORO) {
+ // Kagerou and Oboro can dual wield daggers. [Rytech]
+ if (ep == EQP_HAND_R)
+ return EQP_ARMS;
+ if (ep == EQP_SHADOW_WEAPON)
+ return EQP_SHADOW_ARMS;
+ }
+ }
+ return ep;
+}
+
int pc_setinventorydata(struct map_session_data *sd)
{
int i;
@@ -12044,6 +12072,7 @@ void pc_defaults(void) {
pc->isequip = pc_isequip;
pc->equippoint = pc_equippoint;
+ pc->item_equippoint = pc_item_equippoint;
pc->setinventorydata = pc_setinventorydata;
pc->checkskill = pc_checkskill;