From e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6 Mon Sep 17 00:00:00 2001 From: ElNounch Date: Mon, 22 Aug 2016 19:43:43 +0200 Subject: Delay EntityChangedWorld players' callback until Entity fully linked to world (#3330) Otherwise, some API calls just don't seem to happen .gitignore tweak for test executables --- src/Entities/Player.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Entities/Player.cpp') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index e4c0fdaa5..50bec3608 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1827,8 +1827,7 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d ParentChunk->GetPosX(), ParentChunk->GetPosZ() ); ParentChunk->RemoveEntity(this); - a_World->AddPlayer(this); - cRoot::Get()->GetPluginManager()->CallHookEntityChangedWorld(*this, a_OldWorld); + a_World->AddPlayer(this, &a_OldWorld); // New world will appropriate and announce client at his next tick }); return true; } -- cgit v1.2.3