From 9e94feb923afe8ce73b6590b73f513dd3895e70b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 2 Apr 2018 20:36:17 +0300 Subject: Remove legacy status effect field "block-id". Before was warning about this field for some years. --- src/resources/db/statuseffectdb.cpp | 25 ------------------------- src/resources/db/statuseffectdb.h | 9 --------- 2 files changed, 34 deletions(-) (limited to 'src/resources') diff --git a/src/resources/db/statuseffectdb.cpp b/src/resources/db/statuseffectdb.cpp index 72dbf26a6..77da2737a 100644 --- a/src/resources/db/statuseffectdb.cpp +++ b/src/resources/db/statuseffectdb.cpp @@ -42,17 +42,8 @@ namespace OptionsMap opt1ToIdMap; OptionsMap opt2ToIdMap; OptionsMap opt3ToIdMap; - - OptionsMap blockIdToIdMap; } // namespace -int StatusEffectDB::blockIdToId(const int blockIndex) -{ - if (blockIdToIdMap.find(blockIndex) == blockIdToIdMap.end()) - return -1; - return blockIdToIdMap[blockIndex]; -} - StatusEffect *StatusEffectDB::getStatusEffect(const int index, const Enable enabling) { @@ -78,11 +69,6 @@ void StatusEffectDB::load() SkipError_true); loadXmlDir("statusEffectsPatchDir", loadXmlFile); - if (!blockIdToIdMap.empty()) - { - reportAlways("Detected legacy attribute block-id " - "in status-effects.xml"); - } mLoaded = true; } @@ -113,12 +99,6 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName, } int id = XML::getProperty(node, "id", -1); - - // legacy field. Only for clients 1.6.3.12 and older - const int blockId = XML::getProperty(node, "block-id", -1); - if (id >= 0 && blockId >= 0) - blockIdToIdMap[blockId] = id; - if (id == -1) { id = fakeId; @@ -131,22 +111,18 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName, if (option != 0) { optionToIdMap[option] = id; - settings.legacyEffects = false; } if (opt1 != 0) { opt1ToIdMap[opt1] = id; - settings.legacyEffects = false; } if (opt2 != 0) { opt2ToIdMap[opt2] = id; - settings.legacyEffects = false; } if (opt3 != 0) { opt3ToIdMap[opt3] = id; - settings.legacyEffects = false; } StatusEffect *startEffect = statusEffects[1][id]; @@ -225,7 +201,6 @@ void StatusEffectDB::unload() opt1ToIdMap.clear(); opt2ToIdMap.clear(); opt3ToIdMap.clear(); - blockIdToIdMap.clear(); mLoaded = false; } diff --git a/src/resources/db/statuseffectdb.h b/src/resources/db/statuseffectdb.h index a7a9d5efe..8b0105c2b 100644 --- a/src/resources/db/statuseffectdb.h +++ b/src/resources/db/statuseffectdb.h @@ -48,15 +48,6 @@ namespace StatusEffectDB StatusEffect *getStatusEffect(const int index, const Enable enabling) A_WARN_UNUSED; - /** - * Maps a block effect index to its corresponding effect index. Block - * effect indices are used for opt2/opt3/status.option blocks; their - * mapping to regular effect indices is handled in the config file. - * - * Returns -1 on failure. - */ - int blockIdToId(const int blocKIndex) A_WARN_UNUSED; - void load(); void loadXmlFile(const std::string &fileName, -- cgit v1.2.3-70-g09d2