1
0

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:
Mattes D 2013-12-08 09:07:49 -08:00
commit ac6b4cda7c

View File

@ -608,7 +608,7 @@ void cWorld::GenerateRandomSpawn(void)
{
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
{