summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-04 12:51:10 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-04 12:53:59 +0100
commit1376743e475bfe33336d5c3faad1da73ffac617e (patch)
tree1ad82a72f35fe1474764106df5486385cde30f8e
parentMerge pull request #2939 from LogicParrot/m_Target (diff)
downloadcuberite-1376743e475bfe33336d5c3faad1da73ffac617e.tar
cuberite-1376743e475bfe33336d5c3faad1da73ffac617e.tar.gz
cuberite-1376743e475bfe33336d5c3faad1da73ffac617e.tar.bz2
cuberite-1376743e475bfe33336d5c3faad1da73ffac617e.tar.lz
cuberite-1376743e475bfe33336d5c3faad1da73ffac617e.tar.xz
cuberite-1376743e475bfe33336d5c3faad1da73ffac617e.tar.zst
cuberite-1376743e475bfe33336d5c3faad1da73ffac617e.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Path.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp
index 4db93050e..18090587e 100644
--- a/src/Mobs/Path.cpp
+++ b/src/Mobs/Path.cpp
@@ -508,9 +508,9 @@ void cPath::FillCellAttributes(cPathCell & a_Cell)
a_Cell.m_IsSpecial = true;
a_Cell.m_IsSolid = true; // Specials are solids only from a certain direction. But their m_IsSolid is always true
}
- else if ((a_Cell.m_BlockType == E_BLOCK_AIR) && IsBlockFence(GetCell(Location + Vector3i(0, -1, 0))->m_BlockType))
+ else if ((!cBlockInfo::IsSolid(a_Cell.m_BlockType)) && IsBlockFence(GetCell(Location + Vector3i(0, -1, 0))->m_BlockType))
{
- // Air blocks with fences below them are consider Special Solids. That is, they sometimes behave as solids.
+ // Nonsolid blocks with fences below them are consider Special Solids. That is, they sometimes behave as solids.
a_Cell.m_IsSpecial = true;
a_Cell.m_IsSolid = true;
}
@@ -631,25 +631,29 @@ bool cPath::SpecialIsSolidFromThisDirection(BLOCKTYPE a_Type, NIBBLETYPE a_Meta,
}
-
- switch (a_Type)
+ // If there is a nonsolid above a fence
+ if (!cBlockInfo::IsSolid(a_Type))
{
- // Air is special only when above a fence
- case E_BLOCK_AIR:
- {
- // Treat the air block as solid if the mob is going upward and trying to climb a fence
+ // If we're coming from below
if (a_Direction.y > 0)
{
- return true;
+ return true; // treat the nonsolid as solid
}
else
{
- return false;
+ return false; // Treat it as a nonsolid because we are not coming from below
}
+ }
+
+ /* switch (a_Type)
+ {
+ case E_BLOCK_ETC:
+ {
+ Decide if solid from this direction and return either true or false.
}
// TODO Fill this with the other specials after physics is fixed
- }
+ } */