summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-25 18:33:01 +0200
committermadmaxoft <github@xoft.cz>2014-09-25 18:36:09 +0200
commit843f31ecbace5b78486cb72df9404e0bfec900df (patch)
tree111b8e4f4e1ca5507b5a0dbeda4de0441bbf3a14 /src/Entities
parentMerge pull request #1449 from mc-server/WorldLoader (diff)
downloadcuberite-843f31ecbace5b78486cb72df9404e0bfec900df.tar
cuberite-843f31ecbace5b78486cb72df9404e0bfec900df.tar.gz
cuberite-843f31ecbace5b78486cb72df9404e0bfec900df.tar.bz2
cuberite-843f31ecbace5b78486cb72df9404e0bfec900df.tar.lz
cuberite-843f31ecbace5b78486cb72df9404e0bfec900df.tar.xz
cuberite-843f31ecbace5b78486cb72df9404e0bfec900df.tar.zst
cuberite-843f31ecbace5b78486cb72df9404e0bfec900df.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/HangingEntity.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Entities/HangingEntity.cpp b/src/Entities/HangingEntity.cpp
index 8c70c606e..6e9a89550 100644
--- a/src/Entities/HangingEntity.cpp
+++ b/src/Entities/HangingEntity.cpp
@@ -28,11 +28,17 @@ void cHangingEntity::SpawnOn(cClientHandle & a_ClientHandle)
// The client uses different values for item frame directions and block faces. Our constants are for the block faces, so we convert them here to item frame faces
switch (m_BlockFace)
{
- case BLOCK_FACE_ZP: break; // Initialised to zero
+ case BLOCK_FACE_ZP: Dir = 0; break;
case BLOCK_FACE_ZM: Dir = 2; break;
case BLOCK_FACE_XM: Dir = 1; break;
case BLOCK_FACE_XP: Dir = 3; break;
- default: ASSERT(!"Unhandled block face when trying to spawn item frame!"); return;
+ default:
+ {
+ LOGINFO("Invalid face (%d) in a cHangingEntity at {%d, %d, %d}, adjusting to BLOCK_FACE_XP.",
+ m_BlockFace, (int)GetPosX(), (int)GetPosY(), (int)GetPosZ()
+ );
+ Dir = 3;
+ }
}
if ((Dir == 0) || (Dir == 2)) // Probably a client bug, but two directions are flipped and contrary to the norm, so we do -180