summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-02 20:36:17 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-02 20:36:17 +0300
commit9e94feb923afe8ce73b6590b73f513dd3895e70b (patch)
treec60c6979ef76ebf1b820000883e4c79e6a928777 /src/resources
parentb9584b9b876709ae97e94929d3904975e8143832 (diff)
downloadmanaverse-9e94feb923afe8ce73b6590b73f513dd3895e70b.tar.gz
manaverse-9e94feb923afe8ce73b6590b73f513dd3895e70b.tar.bz2
manaverse-9e94feb923afe8ce73b6590b73f513dd3895e70b.tar.xz
manaverse-9e94feb923afe8ce73b6590b73f513dd3895e70b.zip
Remove legacy status effect field "block-id".
Before was warning about this field for some years.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/db/statuseffectdb.cpp25
-rw-r--r--src/resources/db/statuseffectdb.h9
2 files changed, 0 insertions, 34 deletions
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,