diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-08 18:46:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-08 18:46:21 +0300 |
commit | 461bfb657a0300f27e3ffed55a78ce9249b54759 (patch) | |
tree | 0612c7f0c76bfec8792fbef2643de8cba5d60c0c /src | |
parent | f57e4aa60a10e33ba707417c08eec9a99a796f9e (diff) | |
download | ManaVerse-461bfb657a0300f27e3ffed55a78ce9249b54759.tar.gz ManaVerse-461bfb657a0300f27e3ffed55a78ce9249b54759.tar.bz2 ManaVerse-461bfb657a0300f27e3ffed55a78ce9249b54759.tar.xz ManaVerse-461bfb657a0300f27e3ffed55a78ce9249b54759.zip |
Fix on client side walking on monster wall collision.
Diffstat (limited to 'src')
-rw-r--r-- | src/resources/beingcommon.cpp | 7 | ||||
-rw-r--r-- | src/resources/beingcommon.h | 4 | ||||
-rw-r--r-- | src/resources/db/elementaldb.cpp | 3 | ||||
-rw-r--r-- | src/resources/db/homunculusdb.cpp | 3 | ||||
-rw-r--r-- | src/resources/db/mercenarydb.cpp | 1 | ||||
-rw-r--r-- | src/resources/db/monsterdb.cpp | 4 | ||||
-rw-r--r-- | src/resources/db/npcdb.cpp | 1 | ||||
-rw-r--r-- | src/resources/db/petdb.cpp | 1 | ||||
-rw-r--r-- | src/resources/db/skillunitdb.cpp | 1 |
9 files changed, 24 insertions, 1 deletions
diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp index 1daae68d5..6f9c3aa6d 100644 --- a/src/resources/beingcommon.cpp +++ b/src/resources/beingcommon.cpp @@ -52,7 +52,12 @@ void BeingCommon::readBasicAttributes(BeingInfo *const info, info->setQuickActionEffectId(XML::getProperty(node, "quickActionEffect", -1)); +} +void BeingCommon::readWalkingAttributes(BeingInfo *const info, + XmlNodePtrConst node, + const int moreBlockFlags) +{ unsigned char block = 0; std::string walkStr = XML::getProperty( node, "walkType", "walk"); @@ -61,7 +66,7 @@ void BeingCommon::readBasicAttributes(BeingInfo *const info, BlockMask::WALL | BlockMask::WATER | BlockMask::AIR | - BlockMask::MONSTERWALL; + moreBlockFlags; StringVect tokens; splitToStringVector(tokens, walkStr, ','); FOR_EACH (StringVectCIter, it, tokens) diff --git a/src/resources/beingcommon.h b/src/resources/beingcommon.h index d9de6b783..159cc4518 100644 --- a/src/resources/beingcommon.h +++ b/src/resources/beingcommon.h @@ -53,6 +53,10 @@ namespace BeingCommon XmlNodePtrConst node, const std::string &hoverCursor) A_NONNULL(1); + void readWalkingAttributes(BeingInfo *const info, + XmlNodePtrConst node, + const int moreBlockFlags) A_NONNULL(1); + void getIncludeFiles(const std::string &dir, StringVect &list, const std::string &ext); diff --git a/src/resources/db/elementaldb.cpp b/src/resources/db/elementaldb.cpp index ecfbbcef3..6706c0acb 100644 --- a/src/resources/db/elementaldb.cpp +++ b/src/resources/db/elementaldb.cpp @@ -95,6 +95,9 @@ void ElementalDb::loadXmlFile(const std::string &fileName, currentInfo->setBlockType(BlockType::NONE); BeingCommon::readBasicAttributes(currentInfo, elementalNode, "attack"); + BeingCommon::readWalkingAttributes(currentInfo, + elementalNode, + 0); currentInfo->setMaxHP(XML::getProperty(elementalNode, "maxHP", 0)); diff --git a/src/resources/db/homunculusdb.cpp b/src/resources/db/homunculusdb.cpp index c01c4c2bf..4fe6f65ef 100644 --- a/src/resources/db/homunculusdb.cpp +++ b/src/resources/db/homunculusdb.cpp @@ -95,6 +95,9 @@ void HomunculusDB::loadXmlFile(const std::string &fileName, currentInfo->setBlockType(BlockType::NONE); BeingCommon::readBasicAttributes(currentInfo, homunculusNode, "attack"); + BeingCommon::readWalkingAttributes(currentInfo, + homunculusNode, + 0); currentInfo->setMaxHP(XML::getProperty(homunculusNode, "maxHP", 0)); diff --git a/src/resources/db/mercenarydb.cpp b/src/resources/db/mercenarydb.cpp index 7d481403c..8e3d1f913 100644 --- a/src/resources/db/mercenarydb.cpp +++ b/src/resources/db/mercenarydb.cpp @@ -96,6 +96,7 @@ void MercenaryDB::loadXmlFile(const std::string &fileName, currentInfo->setBlockType(BlockType::NONE); BeingCommon::readBasicAttributes(currentInfo, mercenaryNode, "attack"); + BeingCommon::readWalkingAttributes(currentInfo, mercenaryNode, 0); currentInfo->setMaxHP(XML::getProperty(mercenaryNode, "maxHP", 0)); diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp index f4196ec08..e950072dd 100644 --- a/src/resources/db/monsterdb.cpp +++ b/src/resources/db/monsterdb.cpp @@ -22,6 +22,8 @@ #include "resources/db/monsterdb.h" +#include "enums/resources/map/blockmask.h" + #include "resources/beingcommon.h" #include "resources/beinginfo.h" @@ -101,6 +103,8 @@ void MonsterDB::loadXmlFile(const std::string &fileName, monsterNode, "name", _("unnamed"))); BeingCommon::readBasicAttributes(currentInfo, monsterNode, "attack"); + BeingCommon::readWalkingAttributes(currentInfo, monsterNode, + BlockMask::MONSTERWALL); currentInfo->setMaxHP(XML::getProperty(monsterNode, "maxHP", 0)); diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp index 041306df8..9efcb67a4 100644 --- a/src/resources/db/npcdb.cpp +++ b/src/resources/db/npcdb.cpp @@ -104,6 +104,7 @@ void NPCDB::loadXmlFile(const std::string &fileName, "targetSelection", true)); BeingCommon::readBasicAttributes(currentInfo, npcNode, "talk"); + BeingCommon::readWalkingAttributes(currentInfo, npcNode, 0); currentInfo->setDeadSortOffsetY(XML::getProperty(npcNode, "deadSortOffsetY", 31)); diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp index c89d1bf65..27bd9e89f 100644 --- a/src/resources/db/petdb.cpp +++ b/src/resources/db/petdb.cpp @@ -106,6 +106,7 @@ void PETDB::loadXmlFile(const std::string &fileName, "targetSelection", true)); BeingCommon::readBasicAttributes(currentInfo, petNode, "talk"); + BeingCommon::readWalkingAttributes(currentInfo, petNode, 0); currentInfo->setDeadSortOffsetY(XML::getProperty(petNode, "deadSortOffsetY", 31)); diff --git a/src/resources/db/skillunitdb.cpp b/src/resources/db/skillunitdb.cpp index 6a742e230..d5657596b 100644 --- a/src/resources/db/skillunitdb.cpp +++ b/src/resources/db/skillunitdb.cpp @@ -105,6 +105,7 @@ void SkillUnitDb::loadXmlFile(const std::string &fileName, "targetSelection", true)); BeingCommon::readBasicAttributes(currentInfo, skillUnitNode, "attack"); + BeingCommon::readWalkingAttributes(currentInfo, skillUnitNode, 0); currentInfo->setDeadSortOffsetY(XML::getProperty(skillUnitNode, "deadSortOffsetY", 31)); |