diff options
author | madmaxoft <github@xoft.cz> | 2014-09-23 22:22:38 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-09-23 22:22:38 +0200 |
commit | 8d9dfc5d1a090f163f927484a43baaad49052f31 (patch) | |
tree | 7829c803684adccfb9915e95debdba36082992b7 /src/WorldStorage/WSSAnvil.cpp | |
parent | Fixed compiler warnings in 1.8 protocol. (diff) | |
download | cuberite-8d9dfc5d1a090f163f927484a43baaad49052f31.tar cuberite-8d9dfc5d1a090f163f927484a43baaad49052f31.tar.gz cuberite-8d9dfc5d1a090f163f927484a43baaad49052f31.tar.bz2 cuberite-8d9dfc5d1a090f163f927484a43baaad49052f31.tar.lz cuberite-8d9dfc5d1a090f163f927484a43baaad49052f31.tar.xz cuberite-8d9dfc5d1a090f163f927484a43baaad49052f31.tar.zst cuberite-8d9dfc5d1a090f163f927484a43baaad49052f31.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/WSSAnvil.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index e132a0c26..be526e74e 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -2476,10 +2476,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()); } |