summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2017-08-29 22:29:06 +0200
committerAlexander Harkness <me@bearbin.net>2017-09-01 15:50:02 +0200
commit700bbdabf53ab3b47151271526570f4a862b87f2 (patch)
tree17330438558a38a02c03ddfab489e1d9df8de2c6 /src
parentRemove double-checking below world for burning (diff)
downloadcuberite-700bbdabf53ab3b47151271526570f4a862b87f2.tar
cuberite-700bbdabf53ab3b47151271526570f4a862b87f2.tar.gz
cuberite-700bbdabf53ab3b47151271526570f4a862b87f2.tar.bz2
cuberite-700bbdabf53ab3b47151271526570f4a862b87f2.tar.lz
cuberite-700bbdabf53ab3b47151271526570f4a862b87f2.tar.xz
cuberite-700bbdabf53ab3b47151271526570f4a862b87f2.tar.zst
cuberite-700bbdabf53ab3b47151271526570f4a862b87f2.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp5
-rw-r--r--src/Mobs/Squid.h1
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 598ad4127..15e00871b 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1666,7 +1666,8 @@ void cEntity::SetSwimState(cChunk & a_Chunk)
m_IsSwimming = IsBlockWater(BlockIn);
// Check if the player is submerged:
- VERIFY(a_Chunk.UnboundedRelGetBlockType(RelX, RelY + 1, RelZ, BlockIn));
+ int HeadHeight = CeilC(GetPosY() + GetHeight()) - 1;
+ VERIFY(a_Chunk.UnboundedRelGetBlockType(RelX, HeadHeight, RelZ, BlockIn));
m_IsSubmerged = IsBlockWater(BlockIn);
}
@@ -1698,7 +1699,7 @@ void cEntity::DoSetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ)
void cEntity::HandleAir(void)
{
// Ref.: https://minecraft.gamepedia.com/Chunk_format
- // See if the entity is /submerged/ water (block above is water)
+ // See if the entity is /submerged/ water (head is in water)
// Get the type of block the entity is standing in:
int RespirationLevel = static_cast<int>(GetEquippedHelmet().m_Enchantments.GetLevel(cEnchantments::enchRespiration));
diff --git a/src/Mobs/Squid.h b/src/Mobs/Squid.h
index 590c50495..aeeec77df 100644
--- a/src/Mobs/Squid.h
+++ b/src/Mobs/Squid.h
@@ -23,7 +23,6 @@ public:
// Squids do not drown (or float)
virtual void HandleAir(void) override {}
- virtual void SetSwimState(cChunk & a_Chunk) override {}
} ;