Make Nether portals spawn the player inside of them (#4325)
Currently the player is spawned immediately in front of them. Simply changing `cNetherPortalScanner::OutOffset` to 0.5 wasn't enough, as the player would always be spawned on top of the portal, however checking for non-solid blocks instead of air fixes this.
This commit is contained in:
parent
7d512f2191
commit
10b60971f5
@ -386,8 +386,8 @@ void cPlayer::TickFreezeCode()
|
|||||||
{
|
{
|
||||||
// If we find a position with enough space for the player
|
// If we find a position with enough space for the player
|
||||||
if (
|
if (
|
||||||
(Chunk->GetBlock(Rel.x, NewY, Rel.z) == E_BLOCK_AIR) &&
|
!cBlockInfo::IsSolid(Chunk->GetBlock(Rel.x, NewY, Rel.z)) &&
|
||||||
(Chunk->GetBlock(Rel.x, NewY + 1, Rel.z) == E_BLOCK_AIR)
|
!cBlockInfo::IsSolid(Chunk->GetBlock(Rel.x, NewY + 1, Rel.z))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// If the found position is not the same as the original
|
// If the found position is not the same as the original
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const double cNetherPortalScanner::OutOffset = 2;
|
const double cNetherPortalScanner::OutOffset = 0.5;
|
||||||
const double cNetherPortalScanner::AcrossOffset = 0.5;
|
const double cNetherPortalScanner::AcrossOffset = 0.5;
|
||||||
|
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ void cNetherPortalScanner::OnDisabled(void)
|
|||||||
FLOGD("Building nether portal at {0}", m_PortalLoc);
|
FLOGD("Building nether portal at {0}", m_PortalLoc);
|
||||||
BuildNetherPortal(m_PortalLoc, m_Dir, m_BuildPlatform);
|
BuildNetherPortal(m_PortalLoc, m_Dir, m_BuildPlatform);
|
||||||
m_PortalLoc.x += 1;
|
m_PortalLoc.x += 1;
|
||||||
m_PortalLoc.y += 2;
|
m_PortalLoc.y += 1;
|
||||||
m_PortalLoc.z += 1;
|
m_PortalLoc.z += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user