summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-02 19:34:58 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-02 19:34:58 +0200
commit5c53608dd0e59d67a9aad5b03a58e1ff48d619b3 (patch)
tree69a2dca7e22c0dcfb6f069c81488814ae49c74df /src/Mobs
parentAdded the new functions to APIDump. (diff)
downloadcuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.gz
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.bz2
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.lz
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.xz
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.zst
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index a89fa32a3..b0b836dff 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -710,7 +710,10 @@ void cMonster::SetCustomName(const AString & a_CustomName)
m_CustomName = a_CustomName.substr(0, 64);
}
- m_World->BroadcastEntityMetadata(*this);
+ if (m_World != NULL)
+ {
+ m_World->BroadcastEntityMetadata(*this);
+ }
}
@@ -720,7 +723,10 @@ void cMonster::SetCustomName(const AString & a_CustomName)
void cMonster::SetCustomNameAlwaysVisible(bool a_CustomNameAlwaysVisible)
{
m_CustomNameAlwaysVisible = a_CustomNameAlwaysVisible;
- m_World->BroadcastEntityMetadata(*this);
+ if (m_World != NULL)
+ {
+ m_World->BroadcastEntityMetadata(*this);
+ }
}