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/ItemBoat.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Items/ItemBoat.h') diff --git a/src/Items/ItemBoat.h b/src/Items/ItemBoat.h index be1663eef..ced5ec3a8 100644 --- a/src/Items/ItemBoat.h +++ b/src/Items/ItemBoat.h @@ -96,7 +96,12 @@ public: // Spawn block at water level cBoat * Boat = new cBoat(x + 0.5, y + 0.5, z + 0.5); - Boat->Initialize(*a_World); + if (!Boat->Initialize(*a_World)) + { + delete Boat; + Boat = nullptr; + return false; + } // Remove boat from players hand if (!a_Player->IsGameModeCreative()) -- cgit v1.2.3