From 73a3c4e3be1916bdd4830e7ce7454035a1f572f6 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Tue, 9 May 2017 14:21:25 +0200 Subject: Exported boat - NBT: Added saving / loading of material - Added the material in the item handler of the boat - Drop the correct boat if destroyed - APIDoc: Added desc and functions --- src/WorldStorage/WSSAnvil.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/WorldStorage/WSSAnvil.cpp') diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 47f08e9cf..1d7cedaa6 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1659,11 +1659,17 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Boat = cpp14::make_unique(0, 0, 0); + std::unique_ptr Boat = cpp14::make_unique(0, 0, 0, cBoat::bmOak); if (!LoadEntityBaseFromNBT(*Boat.get(), a_NBT, a_TagIdx)) { return; } + + int TypeIdx = a_NBT.FindChildByName(a_TagIdx, "Type"); + if (TypeIdx > 0) + { + Boat->SetMaterial(cBoat::StringToMaterial(a_NBT.GetString(TypeIdx))); + } a_Entities.push_back(Boat.release()); } -- cgit v1.2.3