From 4ef47aed62364f9cf1474864e5cf94232b4477af Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 Dec 2016 20:12:23 +0000 Subject: Changed entity ownership model to use smart pointers --- src/Items/ItemBoat.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Items/ItemBoat.h') diff --git a/src/Items/ItemBoat.h b/src/Items/ItemBoat.h index bdfed8944..f39a35a88 100644 --- a/src/Items/ItemBoat.h +++ b/src/Items/ItemBoat.h @@ -95,11 +95,8 @@ public: } // Spawn block at water level - cBoat * Boat = new cBoat(x + 0.5, y + 0.5, z + 0.5, cBoat::ItemToMaterial(a_Player->GetEquippedItem())); - if (!Boat->Initialize(*a_World)) + if (a_World->SpawnBoat(x + 0.5, y + 0.5, z + 0.5, cBoat::ItemToMaterial(a_Player->GetEquippedItem())) == cEntity::INVALID_ID) { - delete Boat; - Boat = nullptr; return false; } -- cgit v1.2.3