mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-10 02:08:20 +00:00
remove extra map
This commit is contained in:
parent
693a2fef35
commit
37c2c5db5d
@ -28,7 +28,7 @@
|
|||||||
#include "CDPackageComponentTable.h"
|
#include "CDPackageComponentTable.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const std::map<std::string, std::string> ExtraSettingSaveAbbreviations = {
|
const std::map<std::string, std::string> ExtraSettingAbbreviations = {
|
||||||
{ "assemblyPartLOTs", "ma" },
|
{ "assemblyPartLOTs", "ma" },
|
||||||
{ "blueprintID", "b" },
|
{ "blueprintID", "b" },
|
||||||
{ "userModelID", "ui" },
|
{ "userModelID", "ui" },
|
||||||
@ -42,21 +42,6 @@ namespace {
|
|||||||
{ "userModelOpt", "uo" },
|
{ "userModelOpt", "uo" },
|
||||||
{ "reforgedLOT", "rl" },
|
{ "reforgedLOT", "rl" },
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::map<std::string, std::string> ExtraSettingLoadAbbreviations = {
|
|
||||||
{ "ma", "assemblyPartLOTs" },
|
|
||||||
{ "b", "blueprintID" },
|
|
||||||
{ "ui", "userModelID" },
|
|
||||||
{ "un", "userModelName" },
|
|
||||||
{ "ud", "userModelDesc" },
|
|
||||||
{ "ub", "userModelHasBhvr" },
|
|
||||||
{ "ubh", "userModelBehaviors" },
|
|
||||||
{ "ubs", "userModelBehaviorSourceID" },
|
|
||||||
{ "up", "userModelPhysicsType" },
|
|
||||||
{ "um", "userModelMod" },
|
|
||||||
{ "uo", "userModelOpt" },
|
|
||||||
{ "rl", "reforgedLOT" },
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item::Item(const LWOOBJID id, const LOT lot, Inventory* inventory, const uint32_t slot, const uint32_t count, const bool bound, const std::vector<LDFBaseData*>& config, const LWOOBJID parent, LWOOBJID subKey, eLootSourceType lootSourceType) {
|
Item::Item(const LWOOBJID id, const LOT lot, Inventory* inventory, const uint32_t slot, const uint32_t count, const bool bound, const std::vector<LDFBaseData*>& config, const LWOOBJID parent, LWOOBJID subKey, eLootSourceType lootSourceType) {
|
||||||
@ -557,8 +542,8 @@ void Item::SaveConfigXml(tinyxml2::XMLElement& i) const {
|
|||||||
|
|
||||||
for (const auto* config : this->config) {
|
for (const auto* config : this->config) {
|
||||||
const auto& key = GeneralUtils::UTF16ToWTF8(config->GetKey());
|
const auto& key = GeneralUtils::UTF16ToWTF8(config->GetKey());
|
||||||
const auto saveKey = ExtraSettingSaveAbbreviations.find(key);
|
const auto saveKey = ExtraSettingAbbreviations.find(key);
|
||||||
if (saveKey == ExtraSettingSaveAbbreviations.end()) {
|
if (saveKey == ExtraSettingAbbreviations.end()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -575,11 +560,11 @@ void Item::LoadConfigXml(const tinyxml2::XMLElement& i) {
|
|||||||
const auto* x = i.FirstChildElement("x");
|
const auto* x = i.FirstChildElement("x");
|
||||||
if (!x) return;
|
if (!x) return;
|
||||||
|
|
||||||
for (const auto& pair : ExtraSettingLoadAbbreviations) {
|
for (const auto& pair : ExtraSettingAbbreviations) {
|
||||||
const auto* data = x->Attribute(pair.first.c_str());
|
const auto* data = x->Attribute(pair.second.c_str());
|
||||||
if (!data) continue;
|
if (!data) continue;
|
||||||
|
|
||||||
const auto value = pair.second + "=" + data;
|
const auto value = pair.first + "=" + data;
|
||||||
config.push_back(LDFBaseData::DataFromString(value));
|
config.push_back(LDFBaseData::DataFromString(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user