Sfoglia il codice sorgente

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/

Playtester 8 anni fa
parent
commit
9a130fa0e8
1 ha cambiato i file con 12 aggiunte e 9 eliminazioni
  1. 12 9
      src/map/status.c

+ 12 - 9
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);