Added checks for ice into IsBlockWater()
* This fixes players spawning in vast oceans of ice, as opposed to the previous water
This commit is contained in:
parent
b0784d1931
commit
e26dc5cc0a
@ -254,9 +254,16 @@ inline bool IsValidItem(int a_ItemType)
|
||||
|
||||
|
||||
|
||||
inline bool IsBlockWater(BLOCKTYPE a_BlockType)
|
||||
inline bool IsBlockWater(BLOCKTYPE a_BlockType, bool a_IncludeFrozenWater = false)
|
||||
{
|
||||
return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER));
|
||||
if (a_IncludeFrozenWater)
|
||||
{
|
||||
return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER) || (a_BlockType == E_BLOCK_ICE));
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -635,7 +635,7 @@ void cWorld::GenerateRandomSpawn(void)
|
||||
{
|
||||
LOGD("Generating random spawnpoint...");
|
||||
|
||||
while (IsBlockWater(GetBlock((int)m_SpawnX, GetHeight((int)m_SpawnX, (int)m_SpawnZ), (int)m_SpawnZ)))
|
||||
while (IsBlockWater(GetBlock((int)m_SpawnX, GetHeight((int)m_SpawnX, (int)m_SpawnZ), (int)m_SpawnZ), true))
|
||||
{
|
||||
if ((GetTickRandomNumber(4) % 2) == 0) // Randomise whether to increment X or Z coords
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user