From 21cb9e87a20c46cd46a5cbb7195bdcbfe1feb1ca Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Fri, 27 Aug 2021 00:09:10 +0200 Subject: [PATCH] Fixed a map-server crash (#6223) Fixes #6220 Thanks to @AsurielRO, @Atemo, @aleos89 and @vstumpf --- src/map/skill.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 0db805fb79..2fb56e875f 100755 --- a/src/map/skill.cpp +++ b/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); } }