diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-12-27 15:53:05 +0100 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-12-27 15:53:05 +0100 |
commit | df9825ac09875d58c1da447b736fc59909f68c6f (patch) | |
tree | 62468224aa24dcb7ace48eb53dbcfdd341482e47 | |
parent | Merge pull request #2825 from Gargaj/snowlayers (diff) | |
parent | Deleted cPath::BlockTypeIsFence (diff) | |
download | cuberite-df9825ac09875d58c1da447b736fc59909f68c6f.tar cuberite-df9825ac09875d58c1da447b736fc59909f68c6f.tar.gz cuberite-df9825ac09875d58c1da447b736fc59909f68c6f.tar.bz2 cuberite-df9825ac09875d58c1da447b736fc59909f68c6f.tar.lz cuberite-df9825ac09875d58c1da447b736fc59909f68c6f.tar.xz cuberite-df9825ac09875d58c1da447b736fc59909f68c6f.tar.zst cuberite-df9825ac09875d58c1da447b736fc59909f68c6f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Defines.h | 15 | ||||
-rw-r--r-- | src/Mobs/Path.cpp | 31 | ||||
-rw-r--r-- | src/Mobs/Path.h | 1 |
3 files changed, 13 insertions, 34 deletions
diff --git a/src/Defines.h b/src/Defines.h index b0589d8a0..e2f72ed84 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -481,13 +481,20 @@ inline bool IsBlockFence(BLOCKTYPE a_BlockType) { switch (a_BlockType) { - case E_BLOCK_FENCE: - case E_BLOCK_OAK_FENCE_GATE: - case E_BLOCK_NETHER_BRICK_FENCE: + case E_BLOCK_ACACIA_FENCE: + case E_BLOCK_ACACIA_FENCE_GATE: + case E_BLOCK_BIRCH_FENCE: + case E_BLOCK_BIRCH_FENCE_GATE: case E_BLOCK_COBBLESTONE_WALL: case E_BLOCK_DARK_OAK_FENCE: + case E_BLOCK_DARK_OAK_FENCE_GATE: + case E_BLOCK_FENCE: + case E_BLOCK_JUNGLE_FENCE: + case E_BLOCK_JUNGLE_FENCE_GATE: + case E_BLOCK_NETHER_BRICK_FENCE: + case E_BLOCK_OAK_FENCE_GATE: + case E_BLOCK_SPRUCE_FENCE: case E_BLOCK_SPRUCE_FENCE_GATE: - case E_BLOCK_ACACIA_FENCE: { return true; } diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp index 922e28cdb..03f0ad31a 100644 --- a/src/Mobs/Path.cpp +++ b/src/Mobs/Path.cpp @@ -508,7 +508,7 @@ 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) && BlockTypeIsFence(GetCell(Location + Vector3i(0, -1, 0))->m_BlockType)) + else if ((a_Cell.m_BlockType == E_BLOCK_AIR) && 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. a_Cell.m_IsSpecial = true; @@ -597,7 +597,7 @@ bool cPath::BodyFitsIn(const Vector3i & a_Location, const Vector3i & a_Source) bool cPath::BlockTypeIsSpecial(BLOCKTYPE a_Type) { - if (BlockTypeIsFence(a_Type)) + if (IsBlockFence(a_Type)) { return true; } @@ -619,33 +619,6 @@ bool cPath::BlockTypeIsSpecial(BLOCKTYPE a_Type) } } -bool cPath::BlockTypeIsFence(BLOCKTYPE a_Type) -{ - switch (a_Type) - { - case E_BLOCK_COBBLESTONE_WALL: - case E_BLOCK_FENCE: - case E_BLOCK_OAK_FENCE_GATE: - case E_BLOCK_NETHER_BRICK_FENCE: - case E_BLOCK_SPRUCE_FENCE_GATE: - case E_BLOCK_BIRCH_FENCE_GATE: - case E_BLOCK_JUNGLE_FENCE_GATE: - case E_BLOCK_DARK_OAK_FENCE_GATE: - case E_BLOCK_ACACIA_FENCE_GATE: - case E_BLOCK_SPRUCE_FENCE: - case E_BLOCK_BIRCH_FENCE: - case E_BLOCK_JUNGLE_FENCE: - case E_BLOCK_DARK_OAK_FENCE: - case E_BLOCK_ACACIA_FENCE: - { - return true; - } - default: - { - return false; - } - } -} diff --git a/src/Mobs/Path.h b/src/Mobs/Path.h index c6f47ada3..f51b7da77 100644 --- a/src/Mobs/Path.h +++ b/src/Mobs/Path.h @@ -197,7 +197,6 @@ private: bool IsWalkable(const Vector3i & a_Location, const Vector3i & a_Source); bool BodyFitsIn(const Vector3i & a_Location, const Vector3i & a_Source); bool BlockTypeIsSpecial(BLOCKTYPE a_Type); - bool BlockTypeIsFence(BLOCKTYPE a_Type); // TODO Perhaps this should be moved to cBlockInfo bool SpecialIsSolidFromThisDirection(BLOCKTYPE a_Type, NIBBLETYPE a_Meta, const Vector3i & a_Direction); bool HasSolidBelow(const Vector3i & a_Location); #ifdef COMPILING_PATHFIND_DEBUGGER |