diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-05 23:59:22 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-05 23:59:22 +0200 |
commit | 460d6bd0cbb799a6e68f1bc264f55c3d89eb8206 (patch) | |
tree | 5d5d769e0e624f20c40c90cfb32045e01ec4e3e4 /src/Entities/ProjectileEntity.cpp | |
parent | Crash and compile fix (diff) | |
download | cuberite-460d6bd0cbb799a6e68f1bc264f55c3d89eb8206.tar cuberite-460d6bd0cbb799a6e68f1bc264f55c3d89eb8206.tar.gz cuberite-460d6bd0cbb799a6e68f1bc264f55c3d89eb8206.tar.bz2 cuberite-460d6bd0cbb799a6e68f1bc264f55c3d89eb8206.tar.lz cuberite-460d6bd0cbb799a6e68f1bc264f55c3d89eb8206.tar.xz cuberite-460d6bd0cbb799a6e68f1bc264f55c3d89eb8206.tar.zst cuberite-460d6bd0cbb799a6e68f1bc264f55c3d89eb8206.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/ProjectileEntity.cpp | 72 |
1 files changed, 1 insertions, 71 deletions
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index 50f62b018..334973833 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -142,7 +142,7 @@ public: { if ( (a_Entity == m_Projectile) || // Do not check collisions with self - (a_Entity == m_Projectile->GetCreator()) // Do not check whoever shot the projectile + (a_Entity->GetUniqueID() == m_Projectile->GetCreatorUniqueID()) // Do not check whoever shot the projectile ) { // TODO: Don't check creator only for the first 5 ticks @@ -299,76 +299,6 @@ void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_ -cEntity * cProjectileEntity::GetCreator() -{ - if (m_CreatorData.m_Name.empty() && (m_CreatorData.m_UniqueID >= 1)) - { - class cProjectileCreatorCallback : public cEntityCallback - { - public: - cProjectileCreatorCallback(void) : - m_Entity(NULL) - { - } - - virtual bool Item(cEntity * a_Entity) override - { - m_Entity = a_Entity; - return true; - } - - cEntity * GetEntity(void) - { - return m_Entity; - } - - private: - - cEntity * m_Entity; - }; - - cProjectileCreatorCallback PCC; - GetWorld()->DoWithEntityByID(m_CreatorData.m_UniqueID, PCC); - return PCC.GetEntity(); - } - else if (!m_CreatorData.m_Name.empty()) - { - class cProjectileCreatorCallbackForPlayers : public cPlayerListCallback - { - public: - cProjectileCreatorCallbackForPlayers(void) : - m_Entity(NULL) - { - } - - virtual bool Item(cPlayer * a_Entity) override - { - m_Entity = a_Entity; - return true; - } - - cPlayer * GetEntity(void) - { - return m_Entity; - } - - private: - - cPlayer * m_Entity; - }; - - cProjectileCreatorCallbackForPlayers PCCFP; - GetWorld()->FindAndDoWithPlayer(m_CreatorData.m_Name, PCCFP); - return PCCFP.GetEntity(); - } - - return NULL; -} - - - - - AString cProjectileEntity::GetMCAClassName(void) const { switch (m_ProjectileKind) |