summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/EnchantmentSerializer.cpp
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-19 20:32:10 +0200
committertycho <work.tycho@gmail.com>2015-05-19 20:32:10 +0200
commit77f1f58c0a7eb55001b375f1945690ed5c1e87a2 (patch)
tree99e4b53b2966bd4d9bf545d18ddb7edb89472830 /src/WorldStorage/EnchantmentSerializer.cpp
parentAdded LuaState support for all integral types (diff)
downloadcuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.gz
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.bz2
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.lz
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.xz
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.zst
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.zip
Diffstat (limited to 'src/WorldStorage/EnchantmentSerializer.cpp')
-rw-r--r--src/WorldStorage/EnchantmentSerializer.cpp6
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
}