diff options
author | Dastgir <dastgirpojee@rocketmail.com> | 2015-12-10 16:07:08 +0530 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-12-25 16:09:36 +0100 |
commit | f426844acb3955ba3436d7c0870053c655d70fd1 (patch) | |
tree | 87f80bb4384b7356bdeec01d36553266201c7b7d /src/map/pc.c | |
parent | d9a19c93322de3a7a022b01049b5ce76c9e87b0b (diff) | |
download | hercules-f426844acb3955ba3436d7c0870053c655d70fd1.tar.gz hercules-f426844acb3955ba3436d7c0870053c655d70fd1.tar.bz2 hercules-f426844acb3955ba3436d7c0870053c655d70fd1.tar.xz hercules-f426844acb3955ba3436d7c0870053c655d70fd1.zip |
Implemented NoViewID
(http://herc.ws/board/topic/10020-official-mapflag-to-disable-viewid/)
Closes #926 as merged
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 43d320a80..447bcbd75 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -9400,7 +9400,7 @@ int pc_load_combo(struct map_session_data *sd) { } /** -* Equip item ad given position. +* Equip item at given position. * @param sd the affected player structure. Must be checked before. * @param id item structure for equip. Must be checked before. * @param n inventory item position. Must be checked before. @@ -9408,7 +9408,8 @@ int pc_load_combo(struct map_session_data *sd) { **/ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, int pos) { - if (pos & (EQP_HAND_R|EQP_SHADOW_WEAPON)) { + if ((!map_no_view(sd->bl.m,EQP_SHADOW_WEAPON) && pos & EQP_SHADOW_WEAPON) || + (pos & EQP_HAND_R)) { if(id) sd->weapontype1 = id->look; else @@ -9416,7 +9417,8 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, pc->calcweapontype(sd); clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon); } - if (pos & (EQP_HAND_L|EQP_SHADOW_SHIELD)) { + if ((!map_no_view(sd->bl.m,EQP_SHADOW_SHIELD) && pos & EQP_SHADOW_SHIELD) || + (pos & EQP_HAND_L)) { if (id) { if(id->type == IT_WEAPON) { sd->status.shield = 0; @@ -9432,42 +9434,42 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, } //Added check to prevent sending the same look on multiple slots -> //causes client to redraw item on top of itself. (suggested by Lupus) - if (pos & EQP_HEAD_LOW && pc->checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1) { + if (!map_no_view(sd->bl.m,EQP_HEAD_LOW) && pos & EQP_HEAD_LOW && pc->checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1) { if (id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID))) sd->status.head_bottom = id->look; else sd->status.head_bottom = 0; clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); } - if (pos & EQP_HEAD_TOP && pc->checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1) { + if (!map_no_view(sd->bl.m,EQP_HEAD_TOP) && pos & EQP_HEAD_TOP && pc->checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1) { if (id) sd->status.head_top = id->look; else sd->status.head_top = 0; clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); } - if (pos & EQP_HEAD_MID && pc->checkequip(sd,EQP_COSTUME_HEAD_MID) == -1) { + if (!map_no_view(sd->bl.m,EQP_HEAD_MID) && pos & EQP_HEAD_MID && pc->checkequip(sd,EQP_COSTUME_HEAD_MID) == -1) { if (id && !(pos&EQP_HEAD_TOP)) sd->status.head_mid = id->look; else sd->status.head_mid = 0; clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); } - if (pos & EQP_COSTUME_HEAD_TOP) { + if (!map_no_view(sd->bl.m,EQP_COSTUME_HEAD_TOP) && pos & EQP_COSTUME_HEAD_TOP) { if (id){ sd->status.head_top = id->look; } else sd->status.head_top = 0; clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); } - if (pos & EQP_COSTUME_HEAD_MID) { + if (!map_no_view(sd->bl.m,EQP_COSTUME_HEAD_MID) && pos & EQP_COSTUME_HEAD_MID) { if(id && !(pos&EQP_HEAD_TOP)){ sd->status.head_mid = id->look; } else sd->status.head_mid = 0; clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); } - if (pos & EQP_COSTUME_HEAD_LOW) { + if (!map_no_view(sd->bl.m,EQP_COSTUME_HEAD_LOW) && pos & EQP_COSTUME_HEAD_LOW) { if (id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID))){ sd->status.head_bottom = id->look; } else @@ -9475,14 +9477,14 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); } - if (pos & EQP_SHOES) + if (!map_no_view(sd->bl.m,EQP_SHOES) && pos & EQP_SHOES) clif->changelook(&sd->bl,LOOK_SHOES,0); - if (pos&EQP_GARMENT && pc->checkequip(sd,EQP_COSTUME_GARMENT) == -1) { + if (!map_no_view(sd->bl.m,EQP_GARMENT) && pos&EQP_GARMENT && pc->checkequip(sd,EQP_COSTUME_GARMENT) == -1) { sd->status.robe = id ? id->look : 0; clif->changelook(&sd->bl, LOOK_ROBE, sd->status.robe); } - if (pos & EQP_COSTUME_GARMENT) { + if (!map_no_view(sd->bl.m,EQP_COSTUME_GARMENT) && pos & EQP_COSTUME_GARMENT) { sd->status.robe = id ? id->look : 0; clif->changelook(&sd->bl,LOOK_ROBE,sd->status.robe); } |