Added IsBlockWaterOrIce()
This commit is contained in:
parent
d9a9052de7
commit
0f67f80c6e
@ -254,16 +254,18 @@ inline bool IsValidItem(int a_ItemType)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline bool IsBlockWater(BLOCKTYPE a_BlockType, bool a_IncludeFrozenWater = false)
|
inline bool IsBlockWater(BLOCKTYPE a_BlockType)
|
||||||
{
|
{
|
||||||
if (a_IncludeFrozenWater)
|
return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER));
|
||||||
{
|
}
|
||||||
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));
|
|
||||||
}
|
inline bool IsBlockWaterOrIce(BLOCKTYPE a_BlockType)
|
||||||
|
{
|
||||||
|
return (IsBlockWater(a_BlockType) || (a_BlockType == E_BLOCK_ICE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -633,7 +633,7 @@ void cWorld::GenerateRandomSpawn(void)
|
|||||||
{
|
{
|
||||||
LOGD("Generating random spawnpoint...");
|
LOGD("Generating random spawnpoint...");
|
||||||
|
|
||||||
while (IsBlockWater(GetBlock((int)m_SpawnX, GetHeight((int)m_SpawnX, (int)m_SpawnZ), (int)m_SpawnZ), true))
|
while (IsBlockWaterOrIce(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