From 5580d558a5ede21f856d7b77c3f1ab99a4f088c4 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Tue, 2 May 2017 13:16:59 +0200 Subject: Added missing checks for Initialize function and updated APIDoc --- src/Items/ItemFishingRod.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Items/ItemFishingRod.h') 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(100 + static_cast(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; -- cgit v1.2.3