mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Removed most of non-const static fields in lib. Reduced header includes.
This commit is contained in:
@ -690,7 +690,6 @@ std::shared_ptr<Bonus> JsonUtils::parseBonus(const JsonVector & ability_vec)
|
||||
template <typename T>
|
||||
const T parseByMap(const std::map<std::string, T> & map, const JsonNode * val, const std::string & err)
|
||||
{
|
||||
static T defaultValue = T();
|
||||
if (!val->isNull())
|
||||
{
|
||||
const std::string & type = val->String();
|
||||
@ -698,7 +697,7 @@ const T parseByMap(const std::map<std::string, T> & map, const JsonNode * val, c
|
||||
if (it == map.end())
|
||||
{
|
||||
logMod->error("Error: invalid %s%s.", err, type);
|
||||
return defaultValue;
|
||||
return {};
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -706,7 +705,7 @@ const T parseByMap(const std::map<std::string, T> & map, const JsonNode * val, c
|
||||
}
|
||||
}
|
||||
else
|
||||
return defaultValue;
|
||||
return {};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
Reference in New Issue
Block a user