HangingEntity: Silenced a crash.
Vanilla worlds sometimes contain data that this was asserting upon. Changed into a log.
This commit is contained in:
parent
2867672815
commit
843f31ecba
@ -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
|
// 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)
|
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_ZM: Dir = 2; break;
|
||||||
case BLOCK_FACE_XM: Dir = 1; break;
|
case BLOCK_FACE_XM: Dir = 1; break;
|
||||||
case BLOCK_FACE_XP: Dir = 3; 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
|
if ((Dir == 0) || (Dir == 2)) // Probably a client bug, but two directions are flipped and contrary to the norm, so we do -180
|
||||||
|
Loading…
Reference in New Issue
Block a user