Fixed inconsistent meta naming

master
Tiger Wang 2013-09-03 12:33:54 +01:00
parent f4414697af
commit 9c22cf1520
4 changed files with 81 additions and 81 deletions

View File

@ -28302,16 +28302,16 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_constant(tolua_S,"E_META_SNOW_LAYER_SIX",E_META_SNOW_LAYER_SIX); tolua_constant(tolua_S,"E_META_SNOW_LAYER_SIX",E_META_SNOW_LAYER_SIX);
tolua_constant(tolua_S,"E_META_SNOW_LAYER_SEVEN",E_META_SNOW_LAYER_SEVEN); tolua_constant(tolua_S,"E_META_SNOW_LAYER_SEVEN",E_META_SNOW_LAYER_SEVEN);
tolua_constant(tolua_S,"E_META_SNOW_LAYER_EIGHT",E_META_SNOW_LAYER_EIGHT); tolua_constant(tolua_S,"E_META_SNOW_LAYER_EIGHT",E_META_SNOW_LAYER_EIGHT);
tolua_constant(tolua_S,"E_RAIL_ZM_ZP",E_RAIL_ZM_ZP); tolua_constant(tolua_S,"E_META_RAIL_ZM_ZP",E_META_RAIL_ZM_ZP);
tolua_constant(tolua_S,"E_RAIL_XM_XP",E_RAIL_XM_XP); tolua_constant(tolua_S,"E_META_RAIL_XM_XP",E_META_RAIL_XM_XP);
tolua_constant(tolua_S,"E_RAIL_ASCEND_XP",E_RAIL_ASCEND_XP); tolua_constant(tolua_S,"E_META_RAIL_ASCEND_XP",E_META_RAIL_ASCEND_XP);
tolua_constant(tolua_S,"E_RAIL_ASCEND_XM",E_RAIL_ASCEND_XM); tolua_constant(tolua_S,"E_META_RAIL_ASCEND_XM",E_META_RAIL_ASCEND_XM);
tolua_constant(tolua_S,"E_RAIL_ASCEND_ZM",E_RAIL_ASCEND_ZM); tolua_constant(tolua_S,"E_META_RAIL_ASCEND_ZM",E_META_RAIL_ASCEND_ZM);
tolua_constant(tolua_S,"E_RAIL_ASCEND_ZP",E_RAIL_ASCEND_ZP); tolua_constant(tolua_S,"E_META_RAIL_ASCEND_ZP",E_META_RAIL_ASCEND_ZP);
tolua_constant(tolua_S,"E_RAIL_CURVED_ZP_XP",E_RAIL_CURVED_ZP_XP); tolua_constant(tolua_S,"E_META_RAIL_CURVED_ZP_XP",E_META_RAIL_CURVED_ZP_XP);
tolua_constant(tolua_S,"E_RAIL_CURVED_ZP_XM",E_RAIL_CURVED_ZP_XM); tolua_constant(tolua_S,"E_META_RAIL_CURVED_ZP_XM",E_META_RAIL_CURVED_ZP_XM);
tolua_constant(tolua_S,"E_RAIL_CURVED_ZM_XM",E_RAIL_CURVED_ZM_XM); tolua_constant(tolua_S,"E_META_RAIL_CURVED_ZM_XM",E_META_RAIL_CURVED_ZM_XM);
tolua_constant(tolua_S,"E_RAIL_CURVED_ZM_XP",E_RAIL_CURVED_ZM_XP); tolua_constant(tolua_S,"E_META_RAIL_CURVED_ZM_XP",E_META_RAIL_CURVED_ZM_XP);
tolua_constant(tolua_S,"E_META_COAL_NORMAL",E_META_COAL_NORMAL); tolua_constant(tolua_S,"E_META_COAL_NORMAL",E_META_COAL_NORMAL);
tolua_constant(tolua_S,"E_META_COAL_CHARCOAL",E_META_COAL_CHARCOAL); tolua_constant(tolua_S,"E_META_COAL_CHARCOAL",E_META_COAL_CHARCOAL);
tolua_constant(tolua_S,"E_META_DYE_BLACK",E_META_DYE_BLACK); tolua_constant(tolua_S,"E_META_DYE_BLACK",E_META_DYE_BLACK);

View File

@ -561,16 +561,16 @@ enum
E_META_SNOW_LAYER_EIGHT = 7, E_META_SNOW_LAYER_EIGHT = 7,
// E_BLOCK_RAIL metas // E_BLOCK_RAIL metas
E_RAIL_ZM_ZP = 0, E_META_RAIL_ZM_ZP = 0,
E_RAIL_XM_XP = 1, E_META_RAIL_XM_XP = 1,
E_RAIL_ASCEND_XP = 2, E_META_RAIL_ASCEND_XP = 2,
E_RAIL_ASCEND_XM = 3, E_META_RAIL_ASCEND_XM = 3,
E_RAIL_ASCEND_ZM = 4, E_META_RAIL_ASCEND_ZM = 4,
E_RAIL_ASCEND_ZP = 5, E_META_RAIL_ASCEND_ZP = 5,
E_RAIL_CURVED_ZP_XP = 6, E_META_RAIL_CURVED_ZP_XP = 6,
E_RAIL_CURVED_ZP_XM = 7, E_META_RAIL_CURVED_ZP_XM = 7,
E_RAIL_CURVED_ZM_XM = 8, E_META_RAIL_CURVED_ZM_XM = 8,
E_RAIL_CURVED_ZM_XP = 9, E_META_RAIL_CURVED_ZM_XP = 9,
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Item metas: // Item metas:

View File

@ -65,13 +65,13 @@ public:
NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ); NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
switch (Meta) switch (Meta)
{ {
case E_RAIL_ASCEND_XP: case E_META_RAIL_ASCEND_XP:
case E_RAIL_ASCEND_XM: case E_META_RAIL_ASCEND_XM:
case E_RAIL_ASCEND_ZM: case E_META_RAIL_ASCEND_ZM:
case E_RAIL_ASCEND_ZP: case E_META_RAIL_ASCEND_ZP:
{ {
// Mapping between the meta and the neighbors that need checking // Mapping between the meta and the neighbors that need checking
Meta -= E_RAIL_ASCEND_XP; // Base index at zero Meta -= E_META_RAIL_ASCEND_XP; // Base index at zero
static const struct static const struct
{ {
int x, z; int x, z;
@ -126,12 +126,12 @@ public:
} }
if (RailsCnt == 1) if (RailsCnt == 1)
{ {
if (Neighbors[7]) return E_RAIL_ASCEND_ZP; if (Neighbors[7]) return E_META_RAIL_ASCEND_ZP;
else if (Neighbors[6]) return E_RAIL_ASCEND_ZM; else if (Neighbors[6]) return E_META_RAIL_ASCEND_ZM;
else if (Neighbors[5]) return E_RAIL_ASCEND_XM; else if (Neighbors[5]) return E_META_RAIL_ASCEND_XM;
else if (Neighbors[4]) return E_RAIL_ASCEND_XP; else if (Neighbors[4]) return E_META_RAIL_ASCEND_XP;
else if (Neighbors[0] || Neighbors[1]) return E_RAIL_XM_XP; else if (Neighbors[0] || Neighbors[1]) return E_META_RAIL_XM_XP;
else if (Neighbors[2] || Neighbors[3]) return E_RAIL_ZM_ZP; else if (Neighbors[2] || Neighbors[3]) return E_META_RAIL_ZM_ZP;
ASSERT(!"Weird neighbor count"); ASSERT(!"Weird neighbor count");
return Meta; return Meta;
} }
@ -144,16 +144,16 @@ public:
} }
if (RailsCnt > 1) if (RailsCnt > 1)
{ {
if (Neighbors[3] && Neighbors[0]) return E_RAIL_CURVED_ZP_XP; if (Neighbors[3] && Neighbors[0]) return E_META_RAIL_CURVED_ZP_XP;
else if (Neighbors[3] && Neighbors[1]) return E_RAIL_CURVED_ZP_XM; else if (Neighbors[3] && Neighbors[1]) return E_META_RAIL_CURVED_ZP_XM;
else if (Neighbors[2] && Neighbors[0]) return E_RAIL_CURVED_ZM_XP; else if (Neighbors[2] && Neighbors[0]) return E_META_RAIL_CURVED_ZM_XP;
else if (Neighbors[2] && Neighbors[1]) return E_RAIL_CURVED_ZM_XM; else if (Neighbors[2] && Neighbors[1]) return E_META_RAIL_CURVED_ZM_XM;
else if (Neighbors[7] && Neighbors[2]) return E_RAIL_ASCEND_ZP; else if (Neighbors[7] && Neighbors[2]) return E_META_RAIL_ASCEND_ZP;
else if (Neighbors[3] && Neighbors[6]) return E_RAIL_ASCEND_ZM; else if (Neighbors[3] && Neighbors[6]) return E_META_RAIL_ASCEND_ZM;
else if (Neighbors[5] && Neighbors[0]) return E_RAIL_ASCEND_XM; else if (Neighbors[5] && Neighbors[0]) return E_META_RAIL_ASCEND_XM;
else if (Neighbors[4] && Neighbors[1]) return E_RAIL_ASCEND_XP; else if (Neighbors[4] && Neighbors[1]) return E_META_RAIL_ASCEND_XP;
else if (Neighbors[0] && Neighbors[1]) return E_RAIL_XM_XP; else if (Neighbors[0] && Neighbors[1]) return E_META_RAIL_XM_XP;
else if (Neighbors[2] && Neighbors[3]) return E_RAIL_ZM_ZP; else if (Neighbors[2] && Neighbors[3]) return E_META_RAIL_ZM_ZP;
ASSERT(!"Weird neighbor count"); ASSERT(!"Weird neighbor count");
} }
return Meta; return Meta;
@ -169,7 +169,7 @@ public:
NIBBLETYPE Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ); NIBBLETYPE Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
switch (Meta) switch (Meta)
{ {
case E_RAIL_ZM_ZP: case E_META_RAIL_ZM_ZP:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH, E_PURE_DOWN) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH, E_PURE_DOWN) ||
@ -181,7 +181,7 @@ public:
break; break;
} }
case E_RAIL_XM_XP: case E_META_RAIL_XM_XP:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_EAST, E_PURE_DOWN) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_EAST, E_PURE_DOWN) ||
@ -193,7 +193,7 @@ public:
break; break;
} }
case E_RAIL_ASCEND_XP: case E_META_RAIL_ASCEND_XP:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_EAST) || IsNotConnected(a_World, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_EAST) ||
@ -205,7 +205,7 @@ public:
break; break;
} }
case E_RAIL_ASCEND_XM: case E_META_RAIL_ASCEND_XM:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_EAST) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_EAST) ||
@ -217,7 +217,7 @@ public:
break; break;
} }
case E_RAIL_ASCEND_ZM: case E_META_RAIL_ASCEND_ZM:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_NORTH) || IsNotConnected(a_World, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_NORTH) ||
@ -229,7 +229,7 @@ public:
break; break;
} }
case E_RAIL_ASCEND_ZP: case E_META_RAIL_ASCEND_ZP:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH) ||
@ -241,7 +241,7 @@ public:
break; break;
} }
case E_RAIL_CURVED_ZP_XP: case E_META_RAIL_CURVED_ZP_XP:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_SOUTH) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_SOUTH) ||
@ -253,7 +253,7 @@ public:
break; break;
} }
case E_RAIL_CURVED_ZP_XM: case E_META_RAIL_CURVED_ZP_XM:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_SOUTH) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_SOUTH) ||
@ -265,7 +265,7 @@ public:
break; break;
} }
case E_RAIL_CURVED_ZM_XM: case E_META_RAIL_CURVED_ZM_XM:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH) ||
@ -277,7 +277,7 @@ public:
break; break;
} }
case E_RAIL_CURVED_ZM_XP: case E_META_RAIL_CURVED_ZM_XP:
{ {
if ( if (
IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH) || IsNotConnected(a_World, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH) ||
@ -325,11 +325,11 @@ public:
case BLOCK_FACE_NORTH: case BLOCK_FACE_NORTH:
{ {
if ( if (
(Meta == E_RAIL_ZM_ZP) || (Meta == E_META_RAIL_ZM_ZP) ||
(Meta == E_RAIL_ASCEND_ZM) || (Meta == E_META_RAIL_ASCEND_ZM) ||
(Meta == E_RAIL_ASCEND_ZP) || (Meta == E_META_RAIL_ASCEND_ZP) ||
(Meta == E_RAIL_CURVED_ZP_XP) || (Meta == E_META_RAIL_CURVED_ZP_XP) ||
(Meta == E_RAIL_CURVED_ZP_XM) (Meta == E_META_RAIL_CURVED_ZP_XM)
) )
{ {
return false; return false;
@ -340,11 +340,11 @@ public:
case BLOCK_FACE_SOUTH: case BLOCK_FACE_SOUTH:
{ {
if ( if (
(Meta == E_RAIL_ZM_ZP) || (Meta == E_META_RAIL_ZM_ZP) ||
(Meta == E_RAIL_ASCEND_ZM) || (Meta == E_META_RAIL_ASCEND_ZM) ||
(Meta == E_RAIL_ASCEND_ZP) || (Meta == E_META_RAIL_ASCEND_ZP) ||
(Meta == E_RAIL_CURVED_ZM_XP) || (Meta == E_META_RAIL_CURVED_ZM_XP) ||
(Meta == E_RAIL_CURVED_ZM_XM) (Meta == E_META_RAIL_CURVED_ZM_XM)
) )
{ {
return false; return false;
@ -355,11 +355,11 @@ public:
case BLOCK_FACE_EAST: case BLOCK_FACE_EAST:
{ {
if ( if (
(Meta == E_RAIL_XM_XP) || (Meta == E_META_RAIL_XM_XP) ||
(Meta == E_RAIL_ASCEND_XP) || (Meta == E_META_RAIL_ASCEND_XP) ||
(Meta == E_RAIL_ASCEND_XM) || (Meta == E_META_RAIL_ASCEND_XM) ||
(Meta == E_RAIL_CURVED_ZP_XM) || (Meta == E_META_RAIL_CURVED_ZP_XM) ||
(Meta == E_RAIL_CURVED_ZM_XM) (Meta == E_META_RAIL_CURVED_ZM_XM)
) )
{ {
return false; return false;
@ -369,11 +369,11 @@ public:
case BLOCK_FACE_WEST: case BLOCK_FACE_WEST:
{ {
if ( if (
(Meta == E_RAIL_XM_XP) || (Meta == E_META_RAIL_XM_XP) ||
(Meta == E_RAIL_ASCEND_XP) || (Meta == E_META_RAIL_ASCEND_XP) ||
(Meta == E_RAIL_ASCEND_XM) || (Meta == E_META_RAIL_ASCEND_XM) ||
(Meta == E_RAIL_CURVED_ZP_XP) || (Meta == E_META_RAIL_CURVED_ZP_XP) ||
(Meta == E_RAIL_CURVED_ZM_XP) (Meta == E_META_RAIL_CURVED_ZM_XP)
) )
{ {
return false; return false;

View File

@ -99,7 +99,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
switch (BelowMeta) switch (BelowMeta)
{ {
case E_RAIL_ZM_ZP: // NORTHSOUTH case E_META_RAIL_ZM_ZP: // NORTHSOUTH
{ {
SetRotation(270); SetRotation(270);
SpeedY = 0; // Don't move vertically as on ground SpeedY = 0; // Don't move vertically as on ground
@ -124,7 +124,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_XM_XP: // EASTWEST case E_META_RAIL_XM_XP: // EASTWEST
{ {
SetRotation(180); SetRotation(180);
SpeedY = 0; SpeedY = 0;
@ -146,7 +146,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_ASCEND_ZM: // ASCEND NORTH case E_META_RAIL_ASCEND_ZM: // ASCEND NORTH
{ {
SetRotation(270); SetRotation(270);
SetPosY(floor(GetPosY()) + 0.2); // It seems it doesn't work without levitation :/ SetPosY(floor(GetPosY()) + 0.2); // It seems it doesn't work without levitation :/
@ -175,7 +175,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_ASCEND_ZP: // ASCEND SOUTH case E_META_RAIL_ASCEND_ZP: // ASCEND SOUTH
{ {
SetRotation(270); SetRotation(270);
SetPosY(floor(GetPosY()) + 0.2); SetPosY(floor(GetPosY()) + 0.2);
@ -204,7 +204,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_ASCEND_XM: // ASCEND EAST case E_META_RAIL_ASCEND_XM: // ASCEND EAST
{ {
SetRotation(180); SetRotation(180);
SetPosY(floor(GetPosY()) + 0.2); SetPosY(floor(GetPosY()) + 0.2);
@ -231,7 +231,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_ASCEND_XP: // ASCEND WEST case E_META_RAIL_ASCEND_XP: // ASCEND WEST
{ {
SetRotation(180); SetRotation(180);
SetPosY(floor(GetPosY()) + 0.2); SetPosY(floor(GetPosY()) + 0.2);
@ -258,7 +258,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_CURVED_ZM_XM: // Ends pointing NORTH and WEST case E_META_RAIL_CURVED_ZM_XM: // Ends pointing NORTH and WEST
{ {
SetRotation(315); // Set correct rotation server side SetRotation(315); // Set correct rotation server side
SetPosY(floor(GetPosY()) + 0.2); // Levitate dat cart SetPosY(floor(GetPosY()) + 0.2); // Levitate dat cart
@ -274,7 +274,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_CURVED_ZM_XP: // Curved NORTH EAST case E_META_RAIL_CURVED_ZM_XP: // Curved NORTH EAST
{ {
SetRotation(225); SetRotation(225);
SetPosY(floor(GetPosY()) + 0.2); SetPosY(floor(GetPosY()) + 0.2);
@ -290,7 +290,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_CURVED_ZP_XM: // Curved SOUTH WEST case E_META_RAIL_CURVED_ZP_XM: // Curved SOUTH WEST
{ {
SetRotation(135); SetRotation(135);
SetPosY(floor(GetPosY()) + 0.2); SetPosY(floor(GetPosY()) + 0.2);
@ -306,7 +306,7 @@ void cMinecart::HandleRailPhysics(float a_Dt, cChunk & a_Chunk)
break; break;
} }
case E_RAIL_CURVED_ZP_XP: // Curved SOUTH EAST case E_META_RAIL_CURVED_ZP_XP: // Curved SOUTH EAST
{ {
SetRotation(45); SetRotation(45);
SetPosY(floor(GetPosY()) + 0.2); SetPosY(floor(GetPosY()) + 0.2);