From ca6ef58b1ee8521e4b940ee4883dee714960e413 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Fri, 5 Feb 2016 23:45:45 +0200 Subject: Bulk clearing of whitespace --- src/WorldStorage/EnchantmentSerializer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/WorldStorage/EnchantmentSerializer.cpp') diff --git a/src/WorldStorage/EnchantmentSerializer.cpp b/src/WorldStorage/EnchantmentSerializer.cpp index b28e16b1d..9f477f316 100644 --- a/src/WorldStorage/EnchantmentSerializer.cpp +++ b/src/WorldStorage/EnchantmentSerializer.cpp @@ -9,7 +9,7 @@ void EnchantmentSerializer::WriteToNBTCompound(const cEnchantments & a_Enchantme { // Write the enchantments into the specified NBT writer // begin with the LIST tag of the specified name ("ench" or "StoredEnchantments") - + a_Writer.BeginList(a_ListTagName, TAG_Compound); for (cEnchantments::cMap::const_iterator itr = a_Enchantments.m_Enchantments.begin(), end = a_Enchantments.m_Enchantments.end(); itr != end; ++itr) { @@ -38,7 +38,7 @@ void EnchantmentSerializer::ParseFromNBT(cEnchantments & a_Enchantments, const c ASSERT(!"Bad EnchListTag type"); return; } - + // Verify that the list is of Compounds: if (a_NBT.GetChildrenType(a_EnchListTagIdx) != TAG_Compound) { @@ -48,15 +48,15 @@ void EnchantmentSerializer::ParseFromNBT(cEnchantments & a_Enchantments, const c ASSERT(!"Bad EnchListTag children type"); return; } - + a_Enchantments.Clear(); - + // Iterate over all the compound children, parse an enchantment from each: for (int tag = a_NBT.GetFirstChild(a_EnchListTagIdx); tag >= 0; tag = a_NBT.GetNextSibling(tag)) { // tag is the compound inside the "ench" list tag ASSERT(a_NBT.GetType(tag) == TAG_Compound); - + // Search for the id and lvl tags' values: int id = -1, lvl = -1; for (int ch = a_NBT.GetFirstChild(tag); ch >= 0; ch = a_NBT.GetNextSibling(ch)) @@ -74,13 +74,13 @@ void EnchantmentSerializer::ParseFromNBT(cEnchantments & a_Enchantments, const c lvl = a_NBT.GetShort(ch); } } // for ch - children of the compound tag - + if ((id == -1) || (lvl <= 0)) { // Failed to parse either the id or the lvl, skip this compound continue; } - + // Store the enchantment: a_Enchantments.m_Enchantments[id] = static_cast(lvl); } // for tag - children of the ench list tag -- cgit v1.2.3