summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-10 18:11:19 -0200
committershennetsind <ind@henn.et>2014-02-10 18:11:19 -0200
commit7baaf99a171e34c0a0820e5068e02055929d233b (patch)
tree16ef2aca540de37a601f3162f5977fd493954ad9
parentd7067dcce1b44bff709108b9af088490b3819c35 (diff)
downloadhercules-7baaf99a171e34c0a0820e5068e02055929d233b.tar.gz
hercules-7baaf99a171e34c0a0820e5068e02055929d233b.tar.bz2
hercules-7baaf99a171e34c0a0820e5068e02055929d233b.tar.xz
hercules-7baaf99a171e34c0a0820e5068e02055929d233b.zip
Fixed Bug 7949
Issue with combos reapplying themselves upon removal of a duplicate item present (e.g. 2x gloves of a glove that combos with a shield), since 524291493e64 Thanks to Angelmelody http://hercules.ws/board/tracker/issue-7949-item-combo-bug/ Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/map/pc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index e29ef343f..6230ea634 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -8520,6 +8520,7 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) {
success++;
}
+
return success;
}
@@ -8536,7 +8537,7 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
ARR_FIND( 0, sd->combo_count, x, sd->combos[x].id == data->combos[i]->id );
/* no match, skip this combo */
- if( !(x < sd->combo_count) )
+ if( x == sd->combo_count )
continue;
sd->combos[x].bonus = NULL;
@@ -8556,19 +8557,16 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
cursor++;
}
- /* check if combo requirements still fit */
- if( pc->checkcombo( sd, data ) )
- continue;
-
/* it's empty, we can clear all the memory */
if( (sd->combo_count = cursor) == 0 ) {
aFree(sd->combos);
sd->combos = NULL;
-
- return retval; /* we also can return at this point for we have no more combos to check */
+ break;
}
-
}
+
+ /* check if combo requirements still fit -- don't touch retval! */
+ pc->checkcombo( sd, data );
return retval;
}