summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemBow.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-13 00:54:11 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-13 00:54:11 +0200
commit4b093972ea139d057dd523b583352be69bae7edb (patch)
tree1bc8edf1594f4c81bbdd6a68cf7d22f5a2b21341 /src/Items/ItemBow.h
parentAdd doxy-comments. (diff)
parentMerge pull request #1154 from mc-server/trappedchests (diff)
downloadcuberite-4b093972ea139d057dd523b583352be69bae7edb.tar
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.gz
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.bz2
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.lz
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.xz
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.zst
cuberite-4b093972ea139d057dd523b583352be69bae7edb.zip
Diffstat (limited to 'src/Items/ItemBow.h')
-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();