summaryrefslogtreecommitdiffstats
path: root/src/Entities/Minecart.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 13:53:50 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 13:53:50 +0100
commitc2978a34576192d79c1fdc4664eafe316be49e51 (patch)
tree48db5c74ed757bfdf178a70e77eddff693c76a35 /src/Entities/Minecart.cpp
parentHexified colours (diff)
parentUpdated Core (diff)
downloadcuberite-c2978a34576192d79c1fdc4664eafe316be49e51.tar
cuberite-c2978a34576192d79c1fdc4664eafe316be49e51.tar.gz
cuberite-c2978a34576192d79c1fdc4664eafe316be49e51.tar.bz2
cuberite-c2978a34576192d79c1fdc4664eafe316be49e51.tar.lz
cuberite-c2978a34576192d79c1fdc4664eafe316be49e51.tar.xz
cuberite-c2978a34576192d79c1fdc4664eafe316be49e51.tar.zst
cuberite-c2978a34576192d79c1fdc4664eafe316be49e51.zip
Diffstat (limited to 'src/Entities/Minecart.cpp')
-rw-r--r--src/Entities/Minecart.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index d854906b7..f52a7b6d9 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -720,7 +720,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
if (GetSpeedZ() > 0)
{
BLOCKTYPE Block = m_World->GetBlock((int)floor(GetPosX()), (int)floor(GetPosY()), (int)ceil(GetPosZ()));
- if (!IsBlockRail(Block) && g_BlockIsSolid[Block])
+ if (!IsBlockRail(Block) && cBlockInfo::IsSolid(Block))
{
// We could try to detect a block in front based purely on coordinates, but xoft made a bounding box system - why not use? :P
cBoundingBox bbBlock(Vector3d((int)floor(GetPosX()), (int)floor(GetPosY()), (int)ceil(GetPosZ())), 0.5, 1);
@@ -737,7 +737,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
else if (GetSpeedZ() < 0)
{
BLOCKTYPE Block = m_World->GetBlock((int)floor(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ()) - 1);
- if (!IsBlockRail(Block) && g_BlockIsSolid[Block])
+ if (!IsBlockRail(Block) && cBlockInfo::IsSolid(Block))
{
cBoundingBox bbBlock(Vector3d((int)floor(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ()) - 1), 0.5, 1);
cBoundingBox bbMinecart(Vector3d(GetPosX(), floor(GetPosY()), GetPosZ() - 1), GetWidth() / 2, GetHeight());
@@ -757,7 +757,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
if (GetSpeedX() > 0)
{
BLOCKTYPE Block = m_World->GetBlock((int)ceil(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ()));
- if (!IsBlockRail(Block) && g_BlockIsSolid[Block])
+ if (!IsBlockRail(Block) && cBlockInfo::IsSolid(Block))
{
cBoundingBox bbBlock(Vector3d((int)ceil(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ())), 0.5, 1);
cBoundingBox bbMinecart(Vector3d(GetPosX(), floor(GetPosY()), GetPosZ()), GetWidth() / 2, GetHeight());
@@ -773,7 +773,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
else if (GetSpeedX() < 0)
{
BLOCKTYPE Block = m_World->GetBlock((int)floor(GetPosX()) - 1, (int)floor(GetPosY()), (int)floor(GetPosZ()));
- if (!IsBlockRail(Block) && g_BlockIsSolid[Block])
+ if (!IsBlockRail(Block) && cBlockInfo::IsSolid(Block))
{
cBoundingBox bbBlock(Vector3d((int)floor(GetPosX()) - 1, (int)floor(GetPosY()), (int)floor(GetPosZ())), 0.5, 1);
cBoundingBox bbMinecart(Vector3d(GetPosX() - 1, floor(GetPosY()), GetPosZ()), GetWidth() / 2, GetHeight());
@@ -798,10 +798,10 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
BLOCKTYPE BlockZM = m_World->GetBlock((int)floor(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ()) + 1);
BLOCKTYPE BlockZP = m_World->GetBlock((int)floor(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ()) + 1);
if (
- (!IsBlockRail(BlockXM) && g_BlockIsSolid[BlockXM]) ||
- (!IsBlockRail(BlockXP) && g_BlockIsSolid[BlockXP]) ||
- (!IsBlockRail(BlockZM) && g_BlockIsSolid[BlockZM]) ||
- (!IsBlockRail(BlockZP) && g_BlockIsSolid[BlockZP])
+ (!IsBlockRail(BlockXM) && cBlockInfo::IsSolid(BlockXM)) ||
+ (!IsBlockRail(BlockXP) && cBlockInfo::IsSolid(BlockXP)) ||
+ (!IsBlockRail(BlockZM) && cBlockInfo::IsSolid(BlockZM)) ||
+ (!IsBlockRail(BlockZP) && cBlockInfo::IsSolid(BlockZP))
)
{
SetSpeed(0, 0, 0);