From 43525c5df8ec537d8ce83278795962a3af09f858 Mon Sep 17 00:00:00 2001 From: Peter Bell Date: Sun, 12 Apr 2020 23:04:30 +0100 Subject: Acquire chunk map CS when accessing player entities --- src/Server.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index fcafa5713..d371250ab 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -435,7 +435,14 @@ bool cServer::Start(void) bool cServer::Command(cClientHandle & a_Client, AString & a_Cmd) { - return cRoot::Get()->GetPluginManager()->CallHookChat(*(a_Client.GetPlayer()), a_Cmd); + bool Res = cRoot::Get()->DoWithPlayerByUUID( + a_Client.GetUUID(), + [&](cPlayer & a_Player) + { + return cRoot::Get()->GetPluginManager()->CallHookChat(a_Player, a_Cmd); + } + ); + return Res; } -- cgit v1.2.3