From 48c153bf53d5606e351bd180e2fd9345034f60aa Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 2 Jun 2015 12:51:43 +0200 Subject: Fixed warnings in MSVC. It complained about undefined return values or using uninitialized variables. --- src/Entities/HangingEntity.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/HangingEntity.h b/src/Entities/HangingEntity.h index 4d70cd1a0..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) { @@ -99,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 -- cgit v1.2.3