diff options
author | Mattes D <github@xoft.cz> | 2014-10-15 19:01:55 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-15 19:09:09 +0200 |
commit | eeb580a74e48829908c303f8145802bfa1805c68 (patch) | |
tree | a08569e93e3b203f64237ef5fc6902821e24f83b /src/Entities/ArrowEntity.cpp | |
parent | Usernames are lowercased before generating offline UUID. (diff) | |
download | cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.gz cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.bz2 cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.lz cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.xz cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.zst cuberite-eeb580a74e48829908c303f8145802bfa1805c68.zip |
Diffstat (limited to 'src/Entities/ArrowEntity.cpp')
-rw-r--r-- | src/Entities/ArrowEntity.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp index c265c5043..7e429c62e 100644 --- a/src/Entities/ArrowEntity.cpp +++ b/src/Entities/ArrowEntity.cpp @@ -149,14 +149,14 @@ void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) -void cArrowEntity::CollectedBy(cPlayer * a_Dest) +void cArrowEntity::CollectedBy(cPlayer & a_Dest) { - if (m_IsInGround && !m_bIsCollected && CanPickup(*a_Dest)) + if (m_IsInGround && !m_bIsCollected && CanPickup(a_Dest)) { // Do not add the arrow to the inventory when the player is in creative: - if (!a_Dest->IsGameModeCreative()) + if (!a_Dest.IsGameModeCreative()) { - int NumAdded = a_Dest->GetInventory().AddItem(E_ITEM_ARROW); + int NumAdded = a_Dest.GetInventory().AddItem(E_ITEM_ARROW); if (NumAdded == 0) { // No space in the inventory @@ -164,7 +164,7 @@ void cArrowEntity::CollectedBy(cPlayer * a_Dest) } } - GetWorld()->BroadcastCollectEntity(*this, *a_Dest); + GetWorld()->BroadcastCollectEntity(*this, a_Dest); GetWorld()->BroadcastSoundEffect("random.pop", GetPosX(), GetPosY(), GetPosZ(), 0.5, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); m_bIsCollected = true; } @@ -229,3 +229,7 @@ void cArrowEntity::Tick(float a_Dt, cChunk & a_Chunk) } } } + + + + |