From 47b64b63fabea0f35346934d5bede99f9816add5 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 11 Oct 2013 10:12:36 +0200 Subject: 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. --- source/BlockID.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/BlockID.h') diff --git a/source/BlockID.h b/source/BlockID.h index c2bf8dbdf..28725406d 100644 --- a/source/BlockID.h +++ b/source/BlockID.h @@ -746,8 +746,9 @@ enum eExplosionSource -// fwd: cItem.h: +// fwd: class cItem; +class cIniFile; @@ -785,6 +786,9 @@ extern AString DamageTypeToString(eDamageType a_DamageType); /// Translates a damage type string to damage type. Takes either a number or a damage type alias (built-in). Returns -1 on failure extern eDamageType StringToDamageType(const AString & a_DamageString); +/// Returns a cItem representing the item described in an IniFile's value; if the value doesn't exist, creates it with the provided default. +extern cItem GetIniItemSet(cIniFile & a_IniFile, const char * a_Section, const char * a_Key, const char * a_Default); + // tolua_end -- cgit v1.2.3