From d8fca9f196ad59be5b211325ac2d70e29379e825 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Oct 2012 23:39:39 +0300 Subject: Fix default particle effects in attacks. Was broken in previous commits. Also add default value for "effectId" in paths.xml (by default -1) --- src/resources/beinginfo.cpp | 11 +++++++++++ src/resources/beinginfo.h | 2 ++ src/resources/monsterdb.cpp | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/resources') diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index 9ee0f3de9..eef4ba7b7 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -22,6 +22,7 @@ #include "resources/beinginfo.h" +#include "configuration.h" #include "logger.h" #include "utils/dtor.h" @@ -132,3 +133,13 @@ void BeingInfo::clear() delete empty; empty = nullptr; } + +void BeingInfo::init() +{ + if (empty) + { + empty->mEffectId = paths.getIntValue("effectId"); + empty->mHitEffectId = paths.getIntValue("hitEffectId"); + empty->mCriticalHitEffectId = paths.getIntValue("criticalHitEffectId"); + } +} diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h index 306ac637d..d08e85608 100644 --- a/src/resources/beinginfo.h +++ b/src/resources/beinginfo.h @@ -169,6 +169,8 @@ class BeingInfo final void setDeadSortOffsetY(const int n) { mDeadSortOffsetY = n; } + static void init(); + static void clear(); private: diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index d6aa53809..2bbd51d5a 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -191,7 +191,7 @@ void MonsterDB::load() { const int id = XML::getProperty(spriteNode, "id", 0); const int effectId = XML::getProperty( - spriteNode, "effect-id", -1); + spriteNode, "effect-id", paths.getIntValue("effectId")); int hitEffectId = XML::getProperty(spriteNode, "hit-effect-id", paths.getIntValue("hitEffectId")); int criticalHitEffectId = XML::getProperty(spriteNode, -- cgit v1.2.3-60-g2f50