From 4f3b699b27da11a3641ba3e231bbd4efcfdd9177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Imrich?= Date: Fri, 22 Jan 2021 18:06:26 +0100 Subject: End crystal placement (#5112) * End crystal placement * End crystal placement - fixed error and added some comments * Removed unused includes * Update src/Items/ItemEndCrystal.h Co-authored-by: Alexander Harkness * End Crystal placement, early-return pattern enforcement * End crystal Item finish? * Small changes Fixed a crashbug in ender crystal destruction. According to vanilla 1.16 testing, end crystals don't place if any entity intersects the box, not just other end crystals. Check return value of SpawnEnderCrystal. Add header in SeeMake. Cafe Stile Redux. * The stylechecker relies on CMakeLists * There is another Co-authored-by: Alexander Harkness Co-authored-by: Tiger Wang --- src/Entities/EnderCrystal.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/Entities/EnderCrystal.cpp') 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); + } +} -- cgit v1.2.3