summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-24 15:00:49 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-24 15:00:49 +0200
commit65077c314aa8dea94b37e0d22ced4a09850c8132 (patch)
treefa4c47cd2b299fd760f073dd9a9a66ea3b3a9f7a /src/WorldStorage/WSSAnvil.cpp
parentMerge branch 'master' into WorldLoader (diff)
parentQtBiomeVisualiser: Fixed MSVC path-crossing. (diff)
downloadcuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.gz
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.bz2
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.lz
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.xz
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.zst
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.zip
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rw-r--r--src/WorldStorage/WSSAnvil.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 62f5ef9c0..3821ad976 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -2505,10 +2505,24 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N
Monster->SetIsAngry(Angry);
}
int CollarColorIdx = a_NBT.FindChildByName(a_TagIdx, "CollarColor");
- if ((CollarColorIdx > 0) && (a_NBT.GetType(CollarColorIdx) == TAG_Int))
+ if (CollarColorIdx > 0)
{
- int CollarColor = a_NBT.GetInt(CollarColorIdx);
- Monster->SetCollarColor(CollarColor);
+ switch (a_NBT.GetType(CollarColorIdx))
+ {
+ case TAG_Byte:
+ {
+ // Vanilla uses this
+ unsigned char CollarColor = a_NBT.GetByte(CollarColorIdx);
+ Monster->SetCollarColor(CollarColor);
+ break;
+ }
+ case TAG_Int:
+ {
+ // Old MCS code used this, keep reading it for compatibility reasons:
+ Monster->SetCollarColor(a_NBT.GetInt(CollarColorIdx));
+ break;
+ }
+ }
}
a_Entities.push_back(Monster.release());
}