diff options
author | madmaxoft <github@xoft.cz> | 2014-07-15 09:01:32 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-15 09:01:32 +0200 |
commit | 8e946da8ac109a8bedf9d243251f9a18d29e5a1a (patch) | |
tree | 30f046ddec20d809e3fa84e78b76f31915a361c2 /src/Items/ItemThrowable.h | |
parent | ItemHandler.cpp: removed redundant food and drink checks (diff) | |
parent | Pass cItem by reference. (diff) | |
download | cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.gz cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.bz2 cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.lz cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.xz cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.zst cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.zip |
Diffstat (limited to 'src/Items/ItemThrowable.h')
-rw-r--r-- | src/Items/ItemThrowable.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h index 25935a1bc..c151c5d3a 100644 --- a/src/Items/ItemThrowable.h +++ b/src/Items/ItemThrowable.h @@ -33,16 +33,9 @@ public: // Play sound cFastRandom Random; - a_World->BroadcastSoundEffect( - "random.bow", - (int)std::floor(a_Player->GetPosX() * 8.0), - (int)std::floor((a_Player->GetPosY() - a_Player->GetHeight()) * 8.0), - (int)std::floor(a_Player->GetPosZ() * 8.0), - 0.5F, - 0.4F / (Random.NextFloat(1.0F) * 0.4F + 0.8F) - ); - - if (a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, a_Player->GetEquippedItem(), &Speed) < 0) + a_World->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY() - a_Player->GetHeight(), a_Player->GetPosZ(), 0.5f, 0.4f / (Random.NextFloat(1.0f) * 0.4f + 0.8f)); + + if (a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, &a_Player->GetEquippedItem(), &Speed) < 0) { return false; } @@ -142,7 +135,7 @@ public: return false; } - if (a_World->CreateProjectile(a_BlockX + 0.5, a_BlockY + 1, a_BlockZ + 0.5, m_ProjectileKind, a_Player, a_Player->GetEquippedItem()) < 0) + if (a_World->CreateProjectile(a_BlockX + 0.5, a_BlockY + 1, a_BlockZ + 0.5, m_ProjectileKind, a_Player, &a_Player->GetEquippedItem()) < 0) { return false; } |