summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemFishingRod.h
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2017-05-02 13:16:59 +0200
committerLukas Pioch <lukas@zgow.de>2017-05-08 06:31:45 +0200
commit5580d558a5ede21f856d7b77c3f1ab99a4f088c4 (patch)
tree24772f12098aac2d4576ca6a46bbec47a188f282 /src/Items/ItemFishingRod.h
parentCorrected brewingstand and added support for fuel (diff)
downloadcuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.gz
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.bz2
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.lz
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.xz
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.zst
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.zip
Diffstat (limited to 'src/Items/ItemFishingRod.h')
-rw-r--r--src/Items/ItemFishingRod.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h
index fa27e08f6..3958b12e5 100644
--- a/src/Items/ItemFishingRod.h
+++ b/src/Items/ItemFishingRod.h
@@ -251,7 +251,12 @@ public:
else
{
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);
+ if (!Floater->Initialize(*a_World))
+ {
+ delete Floater;
+ Floater = nullptr;
+ return false;
+ }
a_Player->SetIsFishing(true, Floater->GetUniqueID());
}
return true;