From 7baaf99a171e34c0a0820e5068e02055929d233b Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 10 Feb 2014 18:11:19 -0200 Subject: 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 --- src/map/pc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-70-g09d2