diff options
author | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
---|---|---|
committer | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
commit | 3142598dee31acc23c738a1a728638665c8940b8 (patch) | |
tree | 2eb837ed785678d536d677ff5020fabca089f2e5 /src/WorldStorage/EnchantmentSerializer.cpp | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge pull request #2182 from birkett/master (diff) | |
download | cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.gz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.bz2 cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.lz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.xz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.zst cuberite-3142598dee31acc23c738a1a728638665c8940b8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/EnchantmentSerializer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/WorldStorage/EnchantmentSerializer.cpp b/src/WorldStorage/EnchantmentSerializer.cpp index a6e562956..b28e16b1d 100644 --- a/src/WorldStorage/EnchantmentSerializer.cpp +++ b/src/WorldStorage/EnchantmentSerializer.cpp @@ -14,8 +14,8 @@ void EnchantmentSerializer::WriteToNBTCompound(const cEnchantments & a_Enchantme for (cEnchantments::cMap::const_iterator itr = a_Enchantments.m_Enchantments.begin(), end = a_Enchantments.m_Enchantments.end(); itr != end; ++itr) { a_Writer.BeginCompound(""); - a_Writer.AddShort("id", itr->first); - a_Writer.AddShort("lvl", itr->second); + a_Writer.AddShort("id", static_cast<Int16>(itr->first)); + a_Writer.AddShort("lvl", static_cast<Int16>(itr->second)); a_Writer.EndCompound(); } // for itr - m_Enchantments[] a_Writer.EndList(); @@ -82,7 +82,7 @@ void EnchantmentSerializer::ParseFromNBT(cEnchantments & a_Enchantments, const c } // Store the enchantment: - a_Enchantments.m_Enchantments[id] = lvl; + a_Enchantments.m_Enchantments[id] = static_cast<unsigned int>(lvl); } // for tag - children of the ench list tag } |