summaryrefslogtreecommitdiffstats
path: root/src/NetherPortalScanner.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-06-26 15:12:29 +0200
committerworktycho <work.tycho@gmail.com>2015-06-26 15:12:29 +0200
commit0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5 (patch)
tree893ea949a6e73a914945a62a5fed9ff0266c16b9 /src/NetherPortalScanner.cpp
parentMerge pull request #2282 from Haxi52/button-fixes (diff)
parentWork on NetherPortalScanner. Setup portal scanner to reset PortalCooldown. Changed where player is spawned. Added a_InitSpawn flag to CreateAndInitializeWorld. (diff)
downloadcuberite-0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5.tar
cuberite-0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5.tar.gz
cuberite-0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5.tar.bz2
cuberite-0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5.tar.lz
cuberite-0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5.tar.xz
cuberite-0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5.tar.zst
cuberite-0a7c54261f0da1aa23c942ee6a2cf6fefb4b8ea5.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;
}