From 9a130fa0e8c2990057db45888360b703a93b148d Mon Sep 17 00:00:00 2001 From: Playtester Date: Sun, 30 Oct 2016 13:27:30 +0100 Subject: [PATCH] SG counter and other status variables (bugreport:7449) - Fixed extra status variables not being cleared correctly when the killed unit did not have any status change (e.g. SG counter will now be set back to 0 when a monster dies) Reference: https://rathena.org/board/tracker/issue-7449-storm-gust-counter-does-not-get-reset-on-mob-dead/ --- src/map/status.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/map/status.c b/src/map/status.c index ce4d27787b..b65da65c90 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -11156,7 +11156,18 @@ int status_change_clear(struct block_list* bl, int type) sc = status_get_sc(bl); - if (!sc || !sc->count) + if (!sc) + return 0; + + // Cleaning all extras vars + sc->comet_x = 0; + sc->comet_y = 0; +#ifndef RENEWAL + sc->sg_counter = 0; +#endif + sc->bs_counter = 0; + + if (!sc->count) return 0; for(i = 0; i < SC_MAX; i++) { @@ -11308,14 +11319,6 @@ int status_change_clear(struct block_list* bl, int type) sc->opt2 = 0; sc->opt3 = 0; - // Cleaning all extras vars - sc->comet_x = 0; - sc->comet_y = 0; -#ifndef RENEWAL - sc->sg_counter = 0; -#endif - sc->bs_counter = 0; - if( type == 0 || type == 2 ) clif_changeoption(bl);