[Crash] Bot member zoned crash fix (#3607)

This commit is contained in:
Chris Miles
2023-10-07 13:59:47 -05:00
committed by GitHub
parent 3d95b6c184
commit 68cb94b39c
+6 -1
View File
@@ -555,9 +555,14 @@ void Group::MemberZoned(Mob* removemob) {
//should NOT clear the name, it is used for world communication. //should NOT clear the name, it is used for world communication.
for (auto & m : members) { for (auto & m : members) {
if (m && (m == removemob || (m->IsBot() && m->CastToBot()->GetBotOwner() == removemob))) { if (m) {
if (m->IsBot() && m->CastToBot()->GetBotOwner() && m->CastToBot()->GetBotOwner() == removemob) {
m = nullptr; m = nullptr;
} }
else if (m == removemob) {
m = nullptr;
}
}
} }
if (removemob->IsClient() && HasRole(removemob, RoleAssist)) { if (removemob->IsClient() && HasRole(removemob, RoleAssist)) {