summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorSmokexyz <sagunkho@hotmail.com>2017-04-11 16:13:51 +0800
committerSmokexyz <sagunkho@hotmail.com>2017-04-16 14:00:52 +0800
commitc2d3457d574c2a9bdf9ba4bf799e86c490f9a2c3 (patch)
tree06a8d8f0012aa5048f6337a657c487e3bd987445 /src/map/pc.c
parent974222a8d3f189083205bf5d330de04a43226ad3 (diff)
downloadhercules-c2d3457d574c2a9bdf9ba4bf799e86c490f9a2c3.tar.gz
hercules-c2d3457d574c2a9bdf9ba4bf799e86c490f9a2c3.tar.bz2
hercules-c2d3457d574c2a9bdf9ba4bf799e86c490f9a2c3.tar.xz
hercules-c2d3457d574c2a9bdf9ba4bf799e86c490f9a2c3.zip
Fixes an issue where the unequipped items with options do not re-calculate status.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 2cf5d75b4..120403a2c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9987,7 +9987,7 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
int pc_unequipitem(struct map_session_data *sd,int n,int flag)
{
int i,iflag;
- bool status_cacl = false;
+ bool status_calc = false;
int pos;
nullpo_ret(sd);
@@ -10043,13 +10043,12 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
iflag = sd->npc_item_flag;
/* check for combos (MUST be before status_calc_pc) */
- if ( sd->inventory_data[n] ) {
+ if ( sd->inventory_data[n] != NULL ) {
if( sd->inventory_data[n]->combos_count ) {
if( pc->removecombo(sd,sd->inventory_data[n]) )
- status_cacl = true;
- } if(itemdb_isspecial(sd->status.inventory[n].card[0]))
- ; //No cards
- else {
+ status_calc = true;
+ }
+ if(itemdb_isspecial(sd->status.inventory[n].card[0]) == false) {
for( i = 0; i < sd->inventory_data[n]->slot; i++ ) {
struct item_data *data;
if (!sd->status.inventory[n].card[i])
@@ -10057,14 +10056,26 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
if ( ( data = itemdb->exists(sd->status.inventory[n].card[i]) ) != NULL ) {
if( data->combos_count ) {
if( pc->removecombo(sd,data) )
- status_cacl = true;
+ status_calc = true;
}
}
}
}
+ /* Item Options checking */
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++) {
+ struct item_option *ito = NULL;
+ int16 item_option = sd->status.inventory[n].option[i].index;
+
+ if (item_option <= 0)
+ continue;
+ if ((ito = itemdb->option_exists(sd->status.inventory[n].option[i].index)) == NULL)
+ continue;
+
+ status_calc = true;
+ }
}
- if(flag&PCUNEQUIPITEM_RECALC || status_cacl) {
+ if(flag&PCUNEQUIPITEM_RECALC || status_calc) {
pc->checkallowskill(sd);
status_calc_pc(sd,SCO_NONE);
}