diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2017-08-27 23:37:39 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2017-08-30 19:00:17 +0200 |
commit | 5481249d0f6025251e811f2e35daa79ee7c258aa (patch) | |
tree | 6f2bfd59cbf4d11b1236b8c24e1b1b7dd09077f5 /src/WorldStorage/WSSAnvil.cpp | |
parent | Merge pull request #3969 from peterbell10/cuboid (diff) | |
download | cuberite-VillagerTrading.tar cuberite-VillagerTrading.tar.gz cuberite-VillagerTrading.tar.bz2 cuberite-VillagerTrading.tar.lz cuberite-VillagerTrading.tar.xz cuberite-VillagerTrading.tar.zst cuberite-VillagerTrading.zip |
Diffstat (limited to '')
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index a3251481f..774699b8f 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -2837,9 +2837,13 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - int Type = a_NBT.GetInt(TypeIdx); + int CareerIdx = a_NBT.FindChildByName(a_TagIdx, "Career"); + if (CareerIdx < 0) + { + return; + } - std::unique_ptr<cVillager> Monster = cpp14::make_unique<cVillager>(cVillager::eVillagerType(Type)); + std::unique_ptr<cVillager> Monster = cpp14::make_unique<cVillager>(cVillager::VillagerCareer(a_NBT.GetInt(TypeIdx)), 1U); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; |