Fixed hanging direction bugs.
This commit is contained in:
parent
2867672815
commit
daf5127b28
@ -21,6 +21,21 @@ cHangingEntity::cHangingEntity(eEntityType a_EntityType, eBlockFace a_BlockFace,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void cHangingEntity::SetDirection(eBlockFace a_BlockFace)
|
||||||
|
{
|
||||||
|
if ((a_BlockFace < 2) || (a_BlockFace > 5))
|
||||||
|
{
|
||||||
|
ASSERT(!"Tried to set a bad direction!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_BlockFace = a_BlockFace;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cHangingEntity::SpawnOn(cClientHandle & a_ClientHandle)
|
void cHangingEntity::SpawnOn(cClientHandle & a_ClientHandle)
|
||||||
{
|
{
|
||||||
int Dir = 0;
|
int Dir = 0;
|
||||||
|
@ -24,7 +24,7 @@ public:
|
|||||||
eBlockFace GetDirection() const { return m_BlockFace; } // tolua_export
|
eBlockFace GetDirection() const { return m_BlockFace; } // tolua_export
|
||||||
|
|
||||||
/** Set the orientation from the hanging entity */
|
/** Set the orientation from the hanging entity */
|
||||||
void SetDirection(eBlockFace a_BlockFace) { m_BlockFace = a_BlockFace; } // tolua_export
|
void SetDirection(eBlockFace a_BlockFace); // tolua_export
|
||||||
|
|
||||||
/** Returns the X coord. */
|
/** Returns the X coord. */
|
||||||
int GetTileX() const { return POSX_TOINT; } // tolua_export
|
int GetTileX() const { return POSX_TOINT; } // tolua_export
|
||||||
|
@ -1664,7 +1664,7 @@ void cWSSAnvil::LoadHangingFromNBT(cHangingEntity & a_Hanging, const cParsedNBT
|
|||||||
if (Direction > 0)
|
if (Direction > 0)
|
||||||
{
|
{
|
||||||
Direction = (int)a_NBT.GetByte(Direction);
|
Direction = (int)a_NBT.GetByte(Direction);
|
||||||
if ((Direction < 0) || (Direction > 5))
|
if ((Direction < 2) || (Direction > 5))
|
||||||
{
|
{
|
||||||
a_Hanging.SetDirection(BLOCK_FACE_NORTH);
|
a_Hanging.SetDirection(BLOCK_FACE_NORTH);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user