summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-09 23:04:26 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-09 23:04:26 +0200
commitda1d946b2b6cbb5d3e66c78adc09a4c472e04078 (patch)
tree96ffd9715f36fabf40bc1795325b14f80768db09 /src
parentFixed arrow collection animation (diff)
downloadcuberite-da1d946b2b6cbb5d3e66c78adc09a4c472e04078.tar
cuberite-da1d946b2b6cbb5d3e66c78adc09a4c472e04078.tar.gz
cuberite-da1d946b2b6cbb5d3e66c78adc09a4c472e04078.tar.bz2
cuberite-da1d946b2b6cbb5d3e66c78adc09a4c472e04078.tar.lz
cuberite-da1d946b2b6cbb5d3e66c78adc09a4c472e04078.tar.xz
cuberite-da1d946b2b6cbb5d3e66c78adc09a4c472e04078.tar.zst
cuberite-da1d946b2b6cbb5d3e66c78adc09a4c472e04078.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemBow.h13
1 files 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();