summaryrefslogtreecommitdiffstats
path: root/src/Entities/EnderCrystal.cpp
diff options
context:
space:
mode:
authorDamián Imrich <damian@haze.sk>2021-01-22 18:06:26 +0100
committerGitHub <noreply@github.com>2021-01-22 18:06:26 +0100
commit4f3b699b27da11a3641ba3e231bbd4efcfdd9177 (patch)
tree1513d0b4896bf35ec1b2171ba7836c42d84b990d /src/Entities/EnderCrystal.cpp
parentImplementation of totem of undying behaviour (#5111) (diff)
downloadcuberite-4f3b699b27da11a3641ba3e231bbd4efcfdd9177.tar
cuberite-4f3b699b27da11a3641ba3e231bbd4efcfdd9177.tar.gz
cuberite-4f3b699b27da11a3641ba3e231bbd4efcfdd9177.tar.bz2
cuberite-4f3b699b27da11a3641ba3e231bbd4efcfdd9177.tar.lz
cuberite-4f3b699b27da11a3641ba3e231bbd4efcfdd9177.tar.xz
cuberite-4f3b699b27da11a3641ba3e231bbd4efcfdd9177.tar.zst
cuberite-4f3b699b27da11a3641ba3e231bbd4efcfdd9177.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/EnderCrystal.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Entities/EnderCrystal.cpp b/src/Entities/EnderCrystal.cpp
index 4c21a794d..defa396f5 100644
--- a/src/Entities/EnderCrystal.cpp
+++ b/src/Entities/EnderCrystal.cpp
@@ -89,13 +89,14 @@ void cEnderCrystal::KilledBy(TakeDamageInfo & a_TDI)
{
Super::KilledBy(a_TDI);
- m_World->DoExplosionAt(6.0, GetPosX(), GetPosY() + (GetHeight() / 2.0), GetPosZ(), true, esEnderCrystal, this);
-
+ // Destroy first so the Explodinator doesn't find us (when iterating through entities):
Destroy();
- m_World->SetBlock(POS_TOINT, E_BLOCK_FIRE, 0);
-}
-
-
-
+ m_World->DoExplosionAt(6.0, GetPosX(), GetPosY() + (GetHeight() / 2.0), GetPosZ(), true, esEnderCrystal, this);
+ const auto Position = GetPosition().Floor();
+ if (cChunkDef::IsValidHeight(Position.y))
+ {
+ m_World->SetBlock(Position, E_BLOCK_FIRE, 0);
+ }
+}