summaryrefslogtreecommitdiffstats
path: root/src/Mobs/MobPointer.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 10:29:29 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 10:29:29 +0200
commit7f7c743204bb7fddfd439bcfa84943ba0fe31755 (patch)
treeacd72b62c5bc33dbb45b9ac1b5853f9970d7a45c /src/Mobs/MobPointer.cpp
parenttargetStrikeRange (diff)
downloadcuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.gz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.bz2
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.lz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.xz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.zst
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.zip
Diffstat (limited to 'src/Mobs/MobPointer.cpp')
-rw-r--r--src/Mobs/MobPointer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Mobs/MobPointer.cpp b/src/Mobs/MobPointer.cpp
index b755e3cdf..6e3bccee1 100644
--- a/src/Mobs/MobPointer.cpp
+++ b/src/Mobs/MobPointer.cpp
@@ -1,5 +1,8 @@
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
#include "../Entities/Pawn.h"
#include "MobPointer.h"
+#include "../World.h"
cMobPointer::cMobPointer(cPawn * a_Pointer) : m_Pointer(a_Pointer)
{
@@ -62,11 +65,11 @@ void cMobPointer::operator=(cPawn * a_Pointer)
-cPawn * cMobPointer::GetPointer()
+cPawn * cMobPointer::GetPointer(cWorld * a_CurrentWorld)
{
if (m_Pointer != nullptr)
{
- if (!m_Pointer->IsTicking())
+ if (!m_Pointer->IsTicking() || (m_Pointer->GetWorld() != a_CurrentWorld))
{
m_Pointer = nullptr;
}