Dont crash if facedir > 23

This commit is contained in:
PilzAdam 2013-08-10 16:26:02 +02:00
parent 0d60bc55e4
commit 56b9377c1c

@ -711,7 +711,8 @@ TileSpec getNodeTile(MapNode mn, v3s16 p, v3s16 dir, MeshMakeData *data)
// Get rotation for things like chests
u8 facedir = mn.getFaceDir(ndef);
assert(facedir <= 23);
if (facedir > 23)
facedir = 0;
static const u16 dir_to_tile[24 * 16] =
{
// 0 +X +Y +Z -Z -Y -X -> value=tile,rotation