Selaa lähdekoodia

Fixed missing curly braces in reloadscript

Fixes #3330

Thanks to @hendra814
Lemongrass3110 6 vuotta sitten
vanhempi
commit
123303ef84
1 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 8 8
      src/map/npc.cpp

+ 8 - 8
src/map/npc.cpp

@@ -4432,12 +4432,10 @@ int npc_reload(void) {
 	}
 	mapit_free(iter);
 
-	if(battle_config.dynamic_mobs)
-	{// dynamic check by [random]
-		int16 m;
-		for (m = 0; m < map.size(); m++) {
-			int16 i;
-			for (i = 0; i < MAX_MOB_LIST_PER_MAP; i++) {
+	// dynamic check by [random]
+	if( battle_config.dynamic_mobs ){
+		for( int16 m = 0; m < map.size(); m++ ){
+			for( int16 i = 0; i < MAX_MOB_LIST_PER_MAP; i++ ){
 				if (map[m].moblist[i] != NULL) {
 					aFree(map[m].moblist[i]);
 					map[m].moblist[i] = NULL;
@@ -4447,10 +4445,12 @@ int npc_reload(void) {
 					delete_timer(map[m].mob_delete_timer, map_removemobs_timer);
 					map[m].mob_delete_timer = INVALID_TIMER;
 				}
+
+				if( map[m].npc_num > 0 ){
+					ShowWarning( "npc_reload: %d npcs weren't removed at map %s!\n", map[m].npc_num, map[m].name );
+				}
 			}
 		}
-		if (map[m].npc_num > 0)
-			ShowWarning("npc_reload: %d npcs weren't removed at map %s!\n", map[m].npc_num, map[m].name);
 	}
 
 	// clear mob spawn lookup index