diff options
author | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
---|---|---|
committer | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
commit | 3142598dee31acc23c738a1a728638665c8940b8 (patch) | |
tree | 2eb837ed785678d536d677ff5020fabca089f2e5 /src/Items/ItemBow.h | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge pull request #2182 from birkett/master (diff) | |
download | cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.gz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.bz2 cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.lz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.xz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.zst cuberite-3142598dee31acc23c738a1a728638665c8940b8.zip |
Diffstat (limited to 'src/Items/ItemBow.h')
-rw-r--r-- | src/Items/ItemBow.h | 11 |
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) |