summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-09-29 19:10:04 +0200
committertycho <work.tycho@gmail.com>2015-10-01 15:49:26 +0200
commitdacab890cc3b44fe3be59c8df6af48dd135a8a94 (patch)
tree4b2db89babcaf4068aa66782f57b46499ed8bfa1
parentMerge pull request #2518 from cuberite/UpdateSQLiteCpp (diff)
downloadcuberite-dacab890cc3b44fe3be59c8df6af48dd135a8a94.tar
cuberite-dacab890cc3b44fe3be59c8df6af48dd135a8a94.tar.gz
cuberite-dacab890cc3b44fe3be59c8df6af48dd135a8a94.tar.bz2
cuberite-dacab890cc3b44fe3be59c8df6af48dd135a8a94.tar.lz
cuberite-dacab890cc3b44fe3be59c8df6af48dd135a8a94.tar.xz
cuberite-dacab890cc3b44fe3be59c8df6af48dd135a8a94.tar.zst
cuberite-dacab890cc3b44fe3be59c8df6af48dd135a8a94.zip
-rw-r--r--src/World.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 824ebf3fa..de0dc6ea5 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -624,6 +624,12 @@ void cWorld::GenerateRandomSpawn(void)
bool cWorld::CheckPlayerSpawnPoint(int a_PosX, int a_PosY, int a_PosZ)
{
+ // The bottom layer cannot hold a valid spawn point
+ if (a_PosY <= 0)
+ {
+ return false;
+ }
+
// Check that spawnblock and surrounding blocks are neither solid nor water / lava
static const struct
{