summaryrefslogtreecommitdiffstats
path: root/source/Entities/Player.cpp
diff options
context:
space:
mode:
authorMatyas Dolak <dolak@eset.cz>2013-09-16 15:23:16 +0200
committerMatyas Dolak <dolak@eset.cz>2013-09-16 15:23:16 +0200
commit7e0f56ccce9c2ac698be904667e450baa90b88cd (patch)
treecfe301f1dc0c256a1a89af0015681689dc43fe95 /source/Entities/Player.cpp
parentAPIDump: Added callback examples to cWorld. (diff)
downloadcuberite-7e0f56ccce9c2ac698be904667e450baa90b88cd.tar
cuberite-7e0f56ccce9c2ac698be904667e450baa90b88cd.tar.gz
cuberite-7e0f56ccce9c2ac698be904667e450baa90b88cd.tar.bz2
cuberite-7e0f56ccce9c2ac698be904667e450baa90b88cd.tar.lz
cuberite-7e0f56ccce9c2ac698be904667e450baa90b88cd.tar.xz
cuberite-7e0f56ccce9c2ac698be904667e450baa90b88cd.tar.zst
cuberite-7e0f56ccce9c2ac698be904667e450baa90b88cd.zip
Diffstat (limited to 'source/Entities/Player.cpp')
-rw-r--r--source/Entities/Player.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/Entities/Player.cpp b/source/Entities/Player.cpp
index 04d285b01..9132bdbd0 100644
--- a/source/Entities/Player.cpp
+++ b/source/Entities/Player.cpp
@@ -1448,7 +1448,17 @@ void cPlayer::SetSwimState(cChunk & a_Chunk)
// Check if the player is swimming:
// Use Unbounded, because we're being called *after* processing super::Tick(), which could have changed our chunk
- VERIFY(a_Chunk.UnboundedRelGetBlockType(RelX, RelY, RelZ, BlockIn));
+ if (!a_Chunk.UnboundedRelGetBlockType(RelX, RelY, RelZ, BlockIn))
+ {
+ // This sometimes happens on Linux machines
+ // Ref.: http://forum.mc-server.org/showthread.php?tid=1244
+ LOGD("SetSwimState failure: RelX = %d, RelZ = %d, LastPos = {%.02f, %.02f}, Pos = %.02f, %.02f}",
+ RelX, RelY, m_LastPosX, m_LastPosZ, GetPosX(), GetPosZ()
+ );
+ m_IsSwimming = false;
+ m_IsSubmerged = false;
+ return;
+ }
m_IsSwimming = IsBlockWater(BlockIn);
// Check if the player is submerged: