diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-19 15:38:28 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-03-07 09:54:25 +0100 |
commit | 2d94ced04f34387352e4250363b18a908a67fdf2 (patch) | |
tree | 487486fa4bf0c1b0dffc167eaf3be45feb16d4b2 /src | |
parent | 5dcba0dec84d73a02b08bde21388535a80e94c56 (diff) | |
download | mana-2d94ced04f34387352e4250363b18a908a67fdf2.tar.gz mana-2d94ced04f34387352e4250363b18a908a67fdf2.tar.bz2 mana-2d94ced04f34387352e4250363b18a908a67fdf2.tar.xz mana-2d94ced04f34387352e4250363b18a908a67fdf2.zip |
Renamed ability set to ability category
To match mana/manaserv@9c4b8e24487843f0b52108ba99c8c01f03bfae81.
Diffstat (limited to 'src')
-rw-r--r-- | src/resources/abilitydb.cpp | 21 | ||||
-rw-r--r-- | src/resources/abilitydb.h | 4 | ||||
-rw-r--r-- | src/resources/settingsmanager.cpp | 4 |
3 files changed, 9 insertions, 20 deletions
diff --git a/src/resources/abilitydb.cpp b/src/resources/abilitydb.cpp index 115f120e..a22fb28e 100644 --- a/src/resources/abilitydb.cpp +++ b/src/resources/abilitydb.cpp @@ -50,9 +50,9 @@ void AbilityDB::init() unload(); } -void AbilityDB::readAbilitySetNode(XML::Node node, const std::string &filename) +void AbilityDB::readAbilityCategoryNode(XML::Node node, const std::string &filename) { - std::string setName = node.getProperty("name", "Actions"); + std::string categoryName = node.getProperty("name", "Actions"); for (auto ability : node.children()) { @@ -61,7 +61,7 @@ void AbilityDB::readAbilitySetNode(XML::Node node, const std::string &filename) auto *info = new AbilityInfo(); int id = ability.getProperty("id", 0); info->id = id; - info->set = setName; + info->category = categoryName; info->name = ability.getProperty("name", ""); info->icon = ability.getProperty("icon", ""); @@ -72,14 +72,11 @@ void AbilityDB::readAbilitySetNode(XML::Node node, const std::string &filename) info->rechargeCurrent = 0; if (mAbilityInfos.find(id) != mAbilityInfos.end()) - { logger->log("AbilityDB: Duplicate ability ID %d in %s, ignoring", id, filename.c_str()); - } else { + else mAbilityInfos[id] = info; - } } } - } void AbilityDB::checkStatus() @@ -87,7 +84,6 @@ void AbilityDB::checkStatus() mLoaded = true; } - void AbilityDB::unload() { @@ -97,17 +93,10 @@ void AbilityDB::unload() mLoaded = false; } - AbilityInfo *AbilityDB::get(int id) { - auto i = mAbilityInfos.find(id); - - if (i == mAbilityInfos.end()) - { - return nullptr; - } - else + if (i != mAbilityInfos.end()) { return i->second; } diff --git a/src/resources/abilitydb.h b/src/resources/abilitydb.h index e03a7992..c595d016 100644 --- a/src/resources/abilitydb.h +++ b/src/resources/abilitydb.h @@ -31,7 +31,7 @@ struct AbilityInfo TARGET_POINT // target map location }; int id; - std::string set; // tab on which the ability is shown + std::string category; // tab on which the ability is shown std::string name; // displayed name of ability std::string icon; // filename of graphical icon @@ -49,7 +49,7 @@ namespace AbilityDB { void init(); - void readAbilitySetNode(XML::Node node, const std::string &filename); + void readAbilityCategoryNode(XML::Node node, const std::string &filename); void checkStatus(); diff --git a/src/resources/settingsmanager.cpp b/src/resources/settingsmanager.cpp index b5add444..d3c92387 100644 --- a/src/resources/settingsmanager.cpp +++ b/src/resources/settingsmanager.cpp @@ -214,9 +214,9 @@ namespace SettingsManager { MonsterDB::readMonsterNode(childNode, filename); } - else if (childNode.name() == "ability-set") + else if (childNode.name() == "ability-category") { - AbilityDB::readAbilitySetNode(childNode, filename); + AbilityDB::readAbilityCategoryNode(childNode, filename); } else if (childNode.name() == "npc") { |