diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-03-15 02:46:18 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-03-15 02:46:18 +0100 |
commit | 8316ae330ec06b19caf678b9d499afd198fe5a06 (patch) | |
tree | 9e120574de49e90f970910ffe743e8169d762ceb /src/World.cpp | |
parent | Add item frame saving. (diff) | |
parent | Ignoring all config and SQLite files in the output folder. (diff) | |
download | cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.gz cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.bz2 cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.lz cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.xz cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.zst cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/World.cpp b/src/World.cpp index e208cfe91..012ba915b 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -46,7 +46,6 @@ #include "Generating/Trees.h" #include "Bindings/PluginManager.h" #include "Blocks/BlockHandler.h" -#include "Vector3d.h" #include "Tracer.h" @@ -103,7 +102,7 @@ protected: { for (;;) { - LOG("%d chunks to load, %d chunks to generate", + LOG("" SIZE_T_FMT " chunks to load, %d chunks to generate", m_World->GetStorage().GetLoadQueueLength(), m_World->GetGenerator().GetQueueLength() ); @@ -155,7 +154,7 @@ protected: { for (;;) { - LOG("%d chunks remaining to light", m_Lighting->GetQueueLength() + LOG("" SIZE_T_FMT " chunks remaining to light", m_Lighting->GetQueueLength() ); // Wait for 2 sec, but be "reasonably wakeable" when the thread is to finish @@ -2454,14 +2453,14 @@ cPlayer * cWorld::FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit, { cTracer LineOfSight(this); - float ClosestDistance = a_SightLimit; - cPlayer* ClosestPlayer = NULL; + double ClosestDistance = a_SightLimit; + cPlayer * ClosestPlayer = NULL; cCSLock Lock(m_CSPlayers); for (cPlayerList::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { Vector3f Pos = (*itr)->GetPosition(); - float Distance = (Pos - a_Pos).Length(); + double Distance = (Pos - a_Pos).Length(); if (Distance < ClosestDistance) { @@ -2980,9 +2979,9 @@ int cWorld::SpawnMobFinalize(cMonster * a_Monster) -int cWorld::CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const Vector3d * a_Speed) +int cWorld::CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const cItem a_Item, const Vector3d * a_Speed) { - cProjectileEntity * Projectile = cProjectileEntity::Create(a_Kind, a_Creator, a_PosX, a_PosY, a_PosZ, a_Speed); + cProjectileEntity * Projectile = cProjectileEntity::Create(a_Kind, a_Creator, a_PosX, a_PosY, a_PosZ, a_Item, a_Speed); if (Projectile == NULL) { return -1; @@ -3005,18 +3004,18 @@ void cWorld::TabCompleteUserName(const AString & a_Text, AStringVector & a_Resul cCSLock Lock(m_CSPlayers); for (cPlayerList::iterator itr = m_Players.begin(), end = m_Players.end(); itr != end; ++itr) { - size_t LastSpace = a_Text.find_last_of(" "); //Find the position of the last space + size_t LastSpace = a_Text.find_last_of(" "); // Find the position of the last space - std::string LastWord = a_Text.substr(LastSpace + 1, a_Text.length()); //Find the last word - std::string PlayerName ((*itr)->GetName()); - std::size_t Found = PlayerName.find(LastWord); //Try to find last word in playername + AString LastWord = a_Text.substr(LastSpace + 1, a_Text.length()); // Find the last word + AString PlayerName ((*itr)->GetName()); + size_t Found = PlayerName.find(LastWord); // Try to find last word in playername - if (Found!=0) + if (Found == AString::npos) { - continue; //No match + continue; // No match } - a_Results.push_back((*itr)->GetName()); //Match! + a_Results.push_back(PlayerName); // Match! } } |