1
0

Added GetIniItemSet() function.

It reads a block / item description from the specified INI file value and returns as cItem; stores and uses the default if value doesn't exist.
This commit is contained in:
madmaxoft
2013-10-11 10:12:36 +02:00
parent 85eb85dbf9
commit 47b64b63fa
4 changed files with 73 additions and 8 deletions

View File

@@ -518,6 +518,21 @@ eDamageType StringToDamageType(const AString & a_DamageTypeString)
cItem GetIniItemSet(cIniFile & a_IniFile, const char * a_Section, const char * a_Key, const char * a_Default)
{
AString ItemStr = a_IniFile.GetValueSet(a_Section, a_Key, a_Default);
cItem res;
if (!StringToItem(ItemStr, res))
{
res.Empty();
}
return res;
}
// This is actually just some code that needs to run at program startup, so it is wrapped into a global var's constructor:
class cBlockPropertiesInitializer
{