summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-02-03 07:02:25 +0100
committerMattes D <github@xoft.cz>2014-02-03 07:02:25 +0100
commitb090547c17e919509a85c5810ba7795062987dae (patch)
tree4f73807d49f697e087b98ffb46ba1453345129a0 /src/World.cpp
parentFixed multiple invalid permission nodes (diff)
parentAdded IsBlockWaterOrIce() (diff)
downloadcuberite-b090547c17e919509a85c5810ba7795062987dae.tar
cuberite-b090547c17e919509a85c5810ba7795062987dae.tar.gz
cuberite-b090547c17e919509a85c5810ba7795062987dae.tar.bz2
cuberite-b090547c17e919509a85c5810ba7795062987dae.tar.lz
cuberite-b090547c17e919509a85c5810ba7795062987dae.tar.xz
cuberite-b090547c17e919509a85c5810ba7795062987dae.tar.zst
cuberite-b090547c17e919509a85c5810ba7795062987dae.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 78b42e810..de2002b84 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -632,7 +632,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 (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
{
@@ -1551,7 +1551,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double
a_FlyAwaySpeed /= 100; // Pre-divide, so that we don't have to divide each time inside the loop
for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr)
{
- if (!IsValidItem(itr->m_ItemType))
+ if (!IsValidItem(itr->m_ItemType) || itr->m_ItemType == E_BLOCK_AIR)
{
// Don't spawn pickup if item isn't even valid; should prevent client crashing too
continue;
@@ -1577,7 +1577,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double
{
for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr)
{
- if (!IsValidItem(itr->m_ItemType))
+ if (!IsValidItem(itr->m_ItemType) || itr->m_ItemType == E_BLOCK_AIR)
{
continue;
}