summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2017-08-27 23:37:39 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2017-08-30 19:00:17 +0200
commit5481249d0f6025251e811f2e35daa79ee7c258aa (patch)
tree6f2bfd59cbf4d11b1236b8c24e1b1b7dd09077f5 /src/WorldStorage/WSSAnvil.cpp
parentMerge pull request #3969 from peterbell10/cuboid (diff)
downloadcuberite-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-xsrc/WorldStorage/WSSAnvil.cpp8
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;