1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

- build system update

- compile\warning fixes
This commit is contained in:
Ivan Savenko
2012-09-29 12:02:46 +00:00
parent f8a27a9fdb
commit a602d7e9da
14 changed files with 41 additions and 46 deletions

View File

@@ -928,6 +928,7 @@ Bonus * ParseBonus (const JsonVector &ability_vec) //TODO: merge with AddAbility
template <typename T>
const T & parseByMap(const std::map<std::string, T> & map, const JsonNode * val, std::string err)
{
static T defaultValue;
if (!val->isNull())
{
std::string type = val->String();
@@ -935,7 +936,7 @@ const T & parseByMap(const std::map<std::string, T> & map, const JsonNode * val,
if (it == map.end())
{
tlog1 << "Error: invalid " << err << type << std::endl;
return T();
return defaultValue;
}
else
{
@@ -943,7 +944,7 @@ const T & parseByMap(const std::map<std::string, T> & map, const JsonNode * val,
}
}
else
return T();
return defaultValue;
};
Bonus * ParseBonus (const JsonNode &ability)
@@ -1022,6 +1023,8 @@ DLL_LINKAGE void UnparseBonus( JsonNode &node, const Bonus * bonus )
return it.first;
}
}
assert(0);
return "";
};
node["type"].String() = reverseMap(bonus->type, bonusNameMap);