diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-07 18:39:24 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-07 18:52:06 +0200 |
commit | be64806b1f8f3da2459771e268fd839ee04aa7ba (patch) | |
tree | 819eb073f522195e3ddfe8750e0a722c01a91bba /src/resources/itemdb.cpp | |
parent | 91f54b7fc9c1ad35316575ef10983a0eabafbe83 (diff) | |
download | mana-be64806b1f8f3da2459771e268fd839ee04aa7ba.tar.gz mana-be64806b1f8f3da2459771e268fd839ee04aa7ba.tar.bz2 mana-be64806b1f8f3da2459771e268fd839ee04aa7ba.tar.xz mana-be64806b1f8f3da2459771e268fd839ee04aa7ba.zip |
Merged the unknown item definition loading
and added the default hit effects on it.
Reviewed-by: Jaxad0127.
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r-- | src/resources/itemdb.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index e913bb0a..b9dd8e83 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -64,6 +64,17 @@ static ItemType itemTypeFromString(const std::string &name, int id = 0) else return ITEM_UNUSABLE; } +void ItemDB::loadEmptyItemDefinition() +{ + mUnknown->mName = _("Unknown item"); + mUnknown->mDisplay = SpriteDisplay(); + std::string errFile = paths.getStringValue("spriteErrorFile"); + mUnknown->setSprite(errFile, GENDER_MALE); + mUnknown->setSprite(errFile, GENDER_FEMALE); + mUnknown->setHitEffectId(paths.getIntValue("hitEffectId")); + mUnknown->setCriticalHitEffectId(paths.getIntValue("criticalHitEffectId")); +} + /* * Common itemDB functions */ @@ -321,11 +332,7 @@ void TaItemDB::load() logger->log("Initializing TmwAthena item database..."); mUnknown = new TaItemInfo; - mUnknown->mName = _("Unknown item"); - mUnknown->mDisplay = SpriteDisplay(); - std::string errFile = paths.getStringValue("spriteErrorFile"); - mUnknown->setSprite(errFile, GENDER_MALE); - mUnknown->setSprite(errFile, GENDER_FEMALE); + loadEmptyItemDefinition(); XML::Document doc(ITEMS_DB_FILE); xmlNodePtr rootNode = doc.rootNode(); @@ -422,11 +429,7 @@ void ManaServItemDB::load() logger->log("Initializing ManaServ item database..."); mUnknown = new ManaServItemInfo; - mUnknown->mName = _("Unknown item"); - mUnknown->mDisplay = SpriteDisplay(); - std::string errFile = paths.getStringValue("spriteErrorFile"); - mUnknown->setSprite(errFile, GENDER_MALE); - mUnknown->setSprite(errFile, GENDER_FEMALE); + loadEmptyItemDefinition(); XML::Document doc(ITEMS_DB_FILE); xmlNodePtr rootNode = doc.rootNode(); |