diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-29 18:45:36 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-29 18:45:36 +0200 |
commit | 735d590abf7f804a4504b70c84a289ba86c5f8e3 (patch) | |
tree | 13b603c8bbf8177da92ce87f5413fb646d204f3f /src/Items/ItemFishingRod.h | |
parent | Merge pull request #2376 from mjhanninen/fix-freebsd-build (diff) | |
parent | Silenced and fixed many warning messages across multiple files. (diff) | |
download | cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.gz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.bz2 cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.lz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.xz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.zst cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemFishingRod.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h index 5bf4b29b7..355ff2eae 100644 --- a/src/Items/ItemFishingRod.h +++ b/src/Items/ItemFishingRod.h @@ -27,27 +27,27 @@ class cFloaterCallback : public: cFloaterCallback(void) : m_CanPickup(false), - m_AttachedMobID(-1) + m_AttachedMobID(cEntity::INVALID_ID) { } virtual bool Item(cEntity * a_Entity) override { - m_CanPickup = ((cFloater *)a_Entity)->CanPickup(); + m_CanPickup = reinterpret_cast<cFloater *>(a_Entity)->CanPickup(); m_Pos = Vector3d(a_Entity->GetPosX(), a_Entity->GetPosY(), a_Entity->GetPosZ()); - m_AttachedMobID = ((cFloater *)a_Entity)->GetAttachedMobID(); + m_AttachedMobID = reinterpret_cast<cFloater *>(a_Entity)->GetAttachedMobID(); a_Entity->Destroy(true); return true; } bool CanPickup(void) const { return m_CanPickup; } - bool IsAttached(void) const { return (m_AttachedMobID != -1); } - int GetAttachedMobID(void) const { return m_AttachedMobID; } + bool IsAttached(void) const { return (m_AttachedMobID != cEntity::INVALID_ID); } + UInt32 GetAttachedMobID(void) const { return m_AttachedMobID; } Vector3d GetPos(void) const { return m_Pos; } protected: bool m_CanPickup; - int m_AttachedMobID; + UInt32 m_AttachedMobID; Vector3d m_Pos; } ; @@ -137,7 +137,7 @@ public: } case 2: { - Drops.Add(cItem(E_ITEM_FISHING_ROD, 1, (short)a_World->GetTickRandomNumber(50))); // Fishing rod with durability. TODO: Enchantments on it + Drops.Add(cItem(E_ITEM_FISHING_ROD, 1, static_cast<short>(a_World->GetTickRandomNumber(50)))); // Fishing rod with durability. TODO: Enchantments on it break; } case 3: @@ -168,7 +168,7 @@ public: } else if (Junk <= 4) { - Drops.Add(cItem(E_ITEM_BOW, 1, (short)a_World->GetTickRandomNumber(64))); + Drops.Add(cItem(E_ITEM_BOW, 1, static_cast<short>(a_World->GetTickRandomNumber(64)))); } else if (Junk <= 9) { @@ -244,7 +244,7 @@ public: } else { - cFloater * Floater = new cFloater(a_Player->GetPosX(), a_Player->GetStance(), a_Player->GetPosZ(), a_Player->GetLookVector() * 15, a_Player->GetUniqueID(), 100 + a_World->GetTickRandomNumber(800) - (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100)); + cFloater * Floater = new cFloater(a_Player->GetPosX(), a_Player->GetStance(), a_Player->GetPosZ(), a_Player->GetLookVector() * 15, a_Player->GetUniqueID(), static_cast<int>(100 + static_cast<unsigned int>(a_World->GetTickRandomNumber(800)) - (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100))); Floater->Initialize(*a_World); a_Player->SetIsFishing(true, Floater->GetUniqueID()); } |