From da1d946b2b6cbb5d3e66c78adc09a4c472e04078 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 9 Jul 2014 22:04:26 +0100 Subject: [PATCH] Fixed bow charge --- src/Items/ItemBow.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index 940338d0f..185f17fee 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -55,7 +55,7 @@ public: // Too little force, ignore the shot return; } - Force = std::max(Force, 1.0); + Force = std::min(Force, 1.0); // Create the arrow entity: cArrowEntity * Arrow = new cArrowEntity(*a_Player, Force * 2); @@ -70,16 +70,7 @@ public: return; } - cFastRandom Random; - a_Player->GetWorld()->BroadcastSoundEffect( - "random.bow", - (int)std::floor(a_Player->GetPosX() * 8.0), - (int)std::floor(a_Player->GetPosY() * 8.0), - (int)std::floor(a_Player->GetPosZ() * 8.0), - 1.0F, - 1.0F / (Random.NextFloat(1.0F) * 0.4F + 1.2F) + (float)Force * 0.5F - ); - + a_Player->GetWorld()->BroadcastSoundEffect("random.bow", (int)a_Player->GetPosX() * 8, (int)a_Player->GetPosY() * 8, (int)a_Player->GetPosZ() * 8, 0.5, (float)Force); if (!a_Player->IsGameModeCreative()) { a_Player->UseEquippedItem();