summaryrefslogtreecommitdiffstats
path: root/src/NetherPortalScanner.cpp
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2015-06-13 23:09:43 +0200
committerLane Kolbly <lane@rscheme.org>2015-06-13 23:09:43 +0200
commit9d620a20a0d1fa6af8b6af044610563a7af77712 (patch)
tree461376554da0fe04a69022c217e57873f03fce1b /src/NetherPortalScanner.cpp
parentMerge pull request #2237 from lkolbly/master (diff)
downloadcuberite-9d620a20a0d1fa6af8b6af044610563a7af77712.tar
cuberite-9d620a20a0d1fa6af8b6af044610563a7af77712.tar.gz
cuberite-9d620a20a0d1fa6af8b6af044610563a7af77712.tar.bz2
cuberite-9d620a20a0d1fa6af8b6af044610563a7af77712.tar.lz
cuberite-9d620a20a0d1fa6af8b6af044610563a7af77712.tar.xz
cuberite-9d620a20a0d1fa6af8b6af044610563a7af77712.tar.zst
cuberite-9d620a20a0d1fa6af8b6af044610563a7af77712.zip
Diffstat (limited to 'src/NetherPortalScanner.cpp')
-rw-r--r--src/NetherPortalScanner.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/NetherPortalScanner.cpp b/src/NetherPortalScanner.cpp
index 7bc2d4b7e..cebf09ceb 100644
--- a/src/NetherPortalScanner.cpp
+++ b/src/NetherPortalScanner.cpp
@@ -49,6 +49,12 @@ void cNetherPortalScanner::OnChunkAvailable(int a_ChunkX, int a_ChunkZ)
if (blocks[i] == E_BLOCK_NETHER_PORTAL)
{
Vector3i Coordinate = cChunkDef::IndexToCoordinate(i);
+ if (Coordinate.y >= m_MaxY)
+ {
+ // This is above the map, don't consider it.
+ continue;
+ }
+
Vector3d PortalLoc = Vector3d(Coordinate.x + a_ChunkX * cChunkDef::Width, Coordinate.y, Coordinate.z + a_ChunkZ * cChunkDef::Width);
if (!m_FoundPortal)
{
@@ -284,7 +290,7 @@ void cNetherPortalScanner::OnDisabled(void)
}
LOGD("Placing player at {%f, %f, %f}", Position.x, Position.y, Position.z);
- m_Entity->ScheduleMoveToWorld(m_World, Position);
+ m_Entity->ScheduleMoveToWorld(m_World, Position, true);
delete this;
}