From 90c5c02c694ead254ea3526ed16a51da7755c6c8 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Wed, 15 Mar 2017 12:42:57 +0200 Subject: [PATCH] Fix crash when accessing players not on any map --- GlobalMethods.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GlobalMethods.h b/GlobalMethods.h index 58ba801..c2e2e6d 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -134,6 +134,8 @@ namespace LuaGlobalFunctions /** * Returns a table with all the current [Player]s in the world * + * Does not return players that may be teleporting or otherwise not on any map. + * * enum TeamId * { * TEAM_ALLIANCE = 0, @@ -169,6 +171,8 @@ namespace LuaGlobalFunctions { if (Player* player = it->second) { + if (!player->IsInWorld()) + continue; #ifndef TRINITY if ((team == TEAM_NEUTRAL || player->GetTeamId() == team) && (!onlyGM || player->isGameMaster())) #else