summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 22:43:15 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 22:43:15 +0100
commit1985a9c33edc5b929f88871ce553b148408571af (patch)
tree08124cd9f2ea2171710b2dfb764d6b7dfee5701f /src/World.cpp
parentMentiod that we use some c++11 exstensions (diff)
parent!= FACE_NONE (diff)
downloadcuberite-1985a9c33edc5b929f88871ce553b148408571af.tar
cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.gz
cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.bz2
cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.lz
cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.xz
cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.zst
cuberite-1985a9c33edc5b929f88871ce553b148408571af.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/World.cpp b/src/World.cpp
index f6d277663..2627da0ba 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2980,9 +2980,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 +3005,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!
}
}