Merge pull request #408 from mc-server/SpawnPoint_Fix
Now spawn points will not be in deep oceans or rivers etc.
This commit is contained in:
commit
ac6b4cda7c
@ -608,7 +608,7 @@ void cWorld::GenerateRandomSpawn(void)
|
|||||||
{
|
{
|
||||||
LOGD("Generating random spawnpoint...");
|
LOGD("Generating random spawnpoint...");
|
||||||
|
|
||||||
while (GetBiomeAt((int)m_SpawnX, (int)m_SpawnZ) == biOcean) // Anything but ocean is fine
|
while (IsBlockWater(GetBlock((int)m_SpawnX, GetHeight((int)m_SpawnX, (int)m_SpawnZ), (int)m_SpawnZ)))
|
||||||
{
|
{
|
||||||
if ((GetTickRandomNumber(4) % 2) == 0) // Randomise whether to increment X or Z coords
|
if ((GetTickRandomNumber(4) % 2) == 0) // Randomise whether to increment X or Z coords
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user