Skip to content

Commit

Permalink
Fix sc counters not being reset when a mob unit dies
Browse files Browse the repository at this point in the history
  • Loading branch information
csnv committed Nov 22, 2023
1 parent 95d8d08 commit 7fa862c
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -10596,7 +10596,19 @@ static int status_change_clear(struct block_list *bl, int type)

sc = status->get_sc(bl);

if (!sc || !sc->count)
if (sc == NULL)
return 0;

sc->opt1 = 0;
sc->opt2 = 0;
sc->opt3 = 0;
sc->bs_counter = 0;
sc->fv_counter = 0;
#ifndef RENEWAL
sc->sg_counter = 0;
#endif

if (sc->count == 0)
return 0;

for(i = 0; i < SC_MAX; i++) {
Expand Down Expand Up @@ -10630,15 +10642,6 @@ static int status_change_clear(struct block_list *bl, int type)
}
}

sc->opt1 = 0;
sc->opt2 = 0;
sc->opt3 = 0;
sc->bs_counter = 0;
sc->fv_counter = 0;
#ifndef RENEWAL
sc->sg_counter = 0;
#endif

if( type == 0 || type == 2 )
clif->changeoption(bl);

Expand Down

0 comments on commit 7fa862c

Please sign in to comment.