Преглед на файлове

Fixed a map-server crash (#6223)

Fixes #6220

Thanks to @AsurielRO, @Atemo, @aleos89 and @vstumpf
Lemongrass3110 преди 3 години
родител
ревизия
21cb9e87a2
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      src/map/skill.cpp

+ 2 - 1
src/map/skill.cpp

@@ -19003,7 +19003,8 @@ void skill_clear_unitgroup(struct block_list *src)
 
 	nullpo_retv(ud);
 
-	for (auto it = ud->skillunits.begin(); it != ud->skillunits.end(); it++) {
+	// The after loop statement might look stupid, but this prevents iteration problems, if an entry was deleted
+	for (auto it = ud->skillunits.begin(); it != ud->skillunits.end(); it = ud->skillunits.begin()) {
 		skill_delunitgroup(*it);
 	}
 }