diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-04-18 22:20:28 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-04-18 22:20:28 +0200 |
commit | 931ee84685b979a1b40e8078425600044ce86429 (patch) | |
tree | 3e7de5a5d1187baf2d714bd815b09d16ea0bdf67 /src/Mobs/Monster.cpp | |
parent | Merge pull request #3146 from LogicParrot/snowFix (diff) | |
parent | Fix issues below y = 0 (diff) | |
download | cuberite-931ee84685b979a1b40e8078425600044ce86429.tar cuberite-931ee84685b979a1b40e8078425600044ce86429.tar.gz cuberite-931ee84685b979a1b40e8078425600044ce86429.tar.bz2 cuberite-931ee84685b979a1b40e8078425600044ce86429.tar.lz cuberite-931ee84685b979a1b40e8078425600044ce86429.tar.xz cuberite-931ee84685b979a1b40e8078425600044ce86429.tar.zst cuberite-931ee84685b979a1b40e8078425600044ce86429.zip |
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r-- | src/Mobs/Monster.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index a4cb9e63f..3b0fdd36c 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -667,10 +667,14 @@ void cMonster::InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) NIBBLETYPE BlockMeta; int RelX = static_cast<int>(Destination.x) - Chunk->GetPosX() * cChunkDef::Width; int RelZ = static_cast<int>(Destination.z) - Chunk->GetPosZ() * cChunkDef::Width; - Chunk->GetBlockTypeMeta(RelX, static_cast<int>(Destination.y) - 1, RelZ, BlockType, BlockMeta); - if (BlockType != E_BLOCK_STATIONARY_WATER) // Idle mobs shouldn't enter water on purpose + int YBelowUs = static_cast<int>(Destination.y) - 1; + if (YBelowUs >= 0) { - MoveToPosition(Destination); + Chunk->GetBlockTypeMeta(RelX, YBelowUs, RelZ, BlockType, BlockMeta); + if (BlockType != E_BLOCK_STATIONARY_WATER) // Idle mobs shouldn't enter water on purpose + { + MoveToPosition(Destination); + } } } } |