summaryrefslogtreecommitdiffstats
path: root/src/Entities/HangingEntity.h
diff options
context:
space:
mode:
authorHaoTNN <haotnn@gmail.com>2015-06-03 01:08:57 +0200
committerHaoTNN <haotnn@gmail.com>2015-06-03 01:08:57 +0200
commit3142598dee31acc23c738a1a728638665c8940b8 (patch)
tree2eb837ed785678d536d677ff5020fabca089f2e5 /src/Entities/HangingEntity.h
parentMerge remote-tracking branch 'upstream/master' (diff)
parentMerge pull request #2182 from birkett/master (diff)
downloadcuberite-3142598dee31acc23c738a1a728638665c8940b8.tar
cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.gz
cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.bz2
cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.lz
cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.xz
cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.zst
cuberite-3142598dee31acc23c738a1a728638665c8940b8.zip
Diffstat (limited to 'src/Entities/HangingEntity.h')
-rw-r--r--src/Entities/HangingEntity.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Entities/HangingEntity.h b/src/Entities/HangingEntity.h
index 9d783006c..5d0aa17b3 100644
--- a/src/Entities/HangingEntity.h
+++ b/src/Entities/HangingEntity.h
@@ -46,6 +46,9 @@ public:
protected:
+ Byte m_Facing;
+
+
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override
{
@@ -53,6 +56,7 @@ protected:
UNUSED(a_Chunk);
}
+
/** Converts protocol hanging item facing to eBlockFace values */
inline static eBlockFace ProtocolFaceToBlockFace(Byte a_ProtocolFace)
{
@@ -77,6 +81,7 @@ protected:
return Dir;
}
+
/** Converts eBlockFace values to protocol hanging item faces */
inline static Byte BlockFaceToProtocolFace(eBlockFace a_BlockFace)
{
@@ -89,7 +94,9 @@ protected:
case BLOCK_FACE_ZM: Dir = 2; break;
case BLOCK_FACE_XM: Dir = 1; break;
case BLOCK_FACE_XP: Dir = 3; break;
- default:
+ case BLOCK_FACE_YP:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_NONE:
{
// Uncomment when entities are initialised with their real data, instead of dummy values:
// LOGINFO("Invalid facing (%d) in a cHangingEntity, adjusting to BLOCK_FACE_XP.", a_BlockFace);
@@ -97,13 +104,17 @@ protected:
Dir = cHangingEntity::BlockFaceToProtocolFace(BLOCK_FACE_XP);
}
+ #if !defined(__clang__)
+ default:
+ {
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ }
+ #endif
}
return Dir;
}
-
- Byte m_Facing;
-
}; // tolua_export