summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemBoat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemBoat.h')
-rw-r--r--src/Items/ItemBoat.h7
1 files changed, 6 insertions, 1 deletions
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())