summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-25 15:42:26 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-25 15:42:26 +0100
commit314fc3cdac702a44a257ada5fab52f0a7d37ffcd (patch)
treeb8fe855a3cd86841b16fba630dc7748d59a505fa /src/World.cpp
parentAll mobs now drown (fixes #54) (diff)
downloadcuberite-314fc3cdac702a44a257ada5fab52f0a7d37ffcd.tar
cuberite-314fc3cdac702a44a257ada5fab52f0a7d37ffcd.tar.gz
cuberite-314fc3cdac702a44a257ada5fab52f0a7d37ffcd.tar.bz2
cuberite-314fc3cdac702a44a257ada5fab52f0a7d37ffcd.tar.lz
cuberite-314fc3cdac702a44a257ada5fab52f0a7d37ffcd.tar.xz
cuberite-314fc3cdac702a44a257ada5fab52f0a7d37ffcd.tar.zst
cuberite-314fc3cdac702a44a257ada5fab52f0a7d37ffcd.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 453a22c2d..514524991 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -234,7 +234,11 @@ cWorld::cWorld(const AString & a_WorldName) :
m_WorldName(a_WorldName),
m_IniFileName(m_WorldName + "/world.ini"),
m_StorageSchema("Default"),
+#ifdef _arm_
+ m_StorageCompressionFactor(3),
+#else
m_StorageCompressionFactor(6),
+#endif
m_IsSpawnExplicitlySet(false),
m_WorldAgeSecs(0),
m_TimeOfDaySecs(0),
@@ -2419,7 +2423,7 @@ bool cWorld::FindAndDoWithPlayer(const AString & a_PlayerNameHint, cPlayerListCa
// TODO: This interface is dangerous!
-cPlayer * cWorld::FindClosestPlayer(const Vector3f & a_Pos, float a_SightLimit)
+cPlayer * cWorld::FindClosestPlayer(const Vector3f & a_Pos, float a_SightLimit, bool a_CheckLineOfSight)
{
cTracer LineOfSight(this);
@@ -2434,7 +2438,12 @@ cPlayer * cWorld::FindClosestPlayer(const Vector3f & a_Pos, float a_SightLimit)
if (Distance < ClosestDistance)
{
- if (!LineOfSight.Trace(a_Pos,(Pos - a_Pos),(int)(Pos - a_Pos).Length()))
+ if (a_CheckLineOfSight && !LineOfSight.Trace(a_Pos,(Pos - a_Pos),(int)(Pos - a_Pos).Length()))
+ {
+ ClosestDistance = Distance;
+ ClosestPlayer = *itr;
+ }
+ else
{
ClosestDistance = Distance;
ClosestPlayer = *itr;