summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemBow.h
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-24 13:56:56 +0200
committertycho <work.tycho@gmail.com>2015-05-24 13:56:56 +0200
commitdae9e5792a4f030ae9e748548a16a89790fbd311 (patch)
tree2142b8c4deb9f2c7ad096b8b0ec93fefccd8d8f1 /src/Items/ItemBow.h
parentMerge branch 'master' into PreventNewWarnings (diff)
downloadcuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.gz
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.bz2
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.lz
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.xz
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.zst
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.zip
Diffstat (limited to 'src/Items/ItemBow.h')
-rw-r--r--src/Items/ItemBow.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h
index 5164ddf59..8bbaa3d8c 100644
--- a/src/Items/ItemBow.h
+++ b/src/Items/ItemBow.h
@@ -53,7 +53,7 @@ public:
ASSERT(a_Player != nullptr);
int BowCharge = a_Player->FinishChargingBow();
- double Force = (double)BowCharge / 20.0;
+ double Force = static_cast<double>(BowCharge) / 20.0;
Force = (Force * Force + 2.0 * Force) / 3.0; // This formula is used by the 1.6.2 client
if (Force < 0.1)
{
@@ -80,7 +80,14 @@ public:
Arrow = nullptr;
return;
}
- a_Player->GetWorld()->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY(), a_Player->GetPosZ(), 0.5, (float)Force);
+ a_Player->GetWorld()->BroadcastSoundEffect(
+ "random.bow",
+ a_Player->GetPosX(),
+ a_Player->GetPosY(),
+ a_Player->GetPosZ(),
+ 0.5,
+ static_cast<float>(Force)
+ );
if (!a_Player->IsGameModeCreative())
{
if (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchInfinity) == 0)