mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:23:52 +00:00
Merge pull request #2113 from Capostrophic/fallback
Clean up fallback record creation again
This commit is contained in:
commit
91ec1d1c2c
3 changed files with 45 additions and 66 deletions
|
@ -140,8 +140,6 @@ void ESMStore::setUp(bool validateRecords)
|
||||||
mMagicEffects.setUp();
|
mMagicEffects.setUp();
|
||||||
mAttributes.setUp();
|
mAttributes.setUp();
|
||||||
mDialogs.setUp();
|
mDialogs.setUp();
|
||||||
mStatics.setUp();
|
|
||||||
mDoors.setUp();
|
|
||||||
|
|
||||||
if (validateRecords)
|
if (validateRecords)
|
||||||
validate();
|
validate();
|
||||||
|
|
|
@ -1053,58 +1053,6 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
|
||||||
void Store<ESM::Static>::setUp()
|
|
||||||
{
|
|
||||||
// Load default marker definitions, if game files do not have them for some reason
|
|
||||||
std::pair<std::string, std::string> markers[] = {
|
|
||||||
std::make_pair("divinemarker", "marker_divine.nif"),
|
|
||||||
std::make_pair("doormarker", "marker_arrow.nif"),
|
|
||||||
std::make_pair("northmarker", "marker_north.nif"),
|
|
||||||
std::make_pair("templemarker", "marker_temple.nif"),
|
|
||||||
std::make_pair("travelmarker", "marker_travel.nif")
|
|
||||||
};
|
|
||||||
|
|
||||||
for (const std::pair<std::string, std::string> &marker : markers)
|
|
||||||
{
|
|
||||||
if (search(marker.first) == 0)
|
|
||||||
{
|
|
||||||
ESM::Static newMarker;
|
|
||||||
newMarker.mId = marker.first;
|
|
||||||
newMarker.mModel = marker.second;
|
|
||||||
std::pair<typename Static::iterator, bool> ret = mStatic.insert(std::make_pair(marker.first, newMarker));
|
|
||||||
if (ret.first != mStatic.end())
|
|
||||||
{
|
|
||||||
mShared.push_back(&ret.first->second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
void Store<ESM::Door>::setUp()
|
|
||||||
{
|
|
||||||
// Load default Door type marker definitions
|
|
||||||
std::pair<std::string, std::string> markers[] = {
|
|
||||||
std::make_pair("prisonmarker", "marker_prison.nif")
|
|
||||||
};
|
|
||||||
|
|
||||||
for (const std::pair<std::string, std::string> &marker : markers)
|
|
||||||
{
|
|
||||||
if (search(marker.first) == 0)
|
|
||||||
{
|
|
||||||
ESM::Door newMarker;
|
|
||||||
newMarker.mId = marker.first;
|
|
||||||
newMarker.mModel = marker.second;
|
|
||||||
std::pair<typename Static::iterator, bool> ret = mStatic.insert(std::make_pair(marker.first, newMarker));
|
|
||||||
if (ret.first != mStatic.end())
|
|
||||||
{
|
|
||||||
mShared.push_back(&ret.first->second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline RecordId Store<ESM::Dialogue>::load(ESM::ESMReader &esm) {
|
inline RecordId Store<ESM::Dialogue>::load(ESM::ESMReader &esm) {
|
||||||
// The original letter case of a dialogue ID is saved, because it's printed
|
// The original letter case of a dialogue ID is saved, because it's printed
|
||||||
|
|
|
@ -494,6 +494,17 @@ namespace MWWorld
|
||||||
gmst["iWereWolfBounty"] = ESM::Variant(1000);
|
gmst["iWereWolfBounty"] = ESM::Variant(1000);
|
||||||
gmst["fCombatDistanceWerewolfMod"] = ESM::Variant(0.3f);
|
gmst["fCombatDistanceWerewolfMod"] = ESM::Variant(0.3f);
|
||||||
|
|
||||||
|
for (const std::pair<std::string, ESM::Variant> ¶ms : gmst)
|
||||||
|
{
|
||||||
|
if (!mStore.get<ESM::GameSetting>().search(params.first))
|
||||||
|
{
|
||||||
|
ESM::GameSetting record;
|
||||||
|
record.mId = params.first;
|
||||||
|
record.mValue = params.second;
|
||||||
|
mStore.insertStatic(record);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::map<std::string, ESM::Variant> globals;
|
std::map<std::string, ESM::Variant> globals;
|
||||||
// vanilla Morrowind does not define dayspassed.
|
// vanilla Morrowind does not define dayspassed.
|
||||||
globals["dayspassed"] = ESM::Variant(1); // but the addons start counting at 1 :(
|
globals["dayspassed"] = ESM::Variant(1); // but the addons start counting at 1 :(
|
||||||
|
@ -513,25 +524,47 @@ namespace MWWorld
|
||||||
globals["crimegoldturnin"] = ESM::Variant(0);
|
globals["crimegoldturnin"] = ESM::Variant(0);
|
||||||
globals["pchasturnin"] = ESM::Variant(0);
|
globals["pchasturnin"] = ESM::Variant(0);
|
||||||
|
|
||||||
for (std::map<std::string, ESM::Variant>::iterator it = gmst.begin(); it != gmst.end(); ++it)
|
for (const std::pair<std::string, ESM::Variant> ¶ms : globals)
|
||||||
{
|
{
|
||||||
if (!mStore.get<ESM::GameSetting>().search(it->first))
|
if (!mStore.get<ESM::Global>().search(params.first))
|
||||||
{
|
{
|
||||||
ESM::GameSetting setting;
|
ESM::Global record;
|
||||||
setting.mId = it->first;
|
record.mId = params.first;
|
||||||
setting.mValue = it->second;
|
record.mValue = params.second;
|
||||||
mStore.insertStatic(setting);
|
mStore.insertStatic(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::map<std::string, ESM::Variant>::iterator it = globals.begin(); it != globals.end(); ++it)
|
std::map<std::string, std::string> statics;
|
||||||
|
// Total conversions from SureAI lack marker records
|
||||||
|
statics["divinemarker"] = "marker_divine.nif";
|
||||||
|
statics["doormarker"] = "marker_arrow.nif";
|
||||||
|
statics["northmarker"] = "marker_north.nif";
|
||||||
|
statics["templemarker"] = "marker_temple.nif";
|
||||||
|
statics["travelmarker"] = "marker_travel.nif";
|
||||||
|
|
||||||
|
for (const std::pair<std::string, std::string> ¶ms : statics)
|
||||||
{
|
{
|
||||||
if (!mStore.get<ESM::Global>().search(it->first))
|
if (!mStore.get<ESM::Static>().search(params.first))
|
||||||
{
|
{
|
||||||
ESM::Global setting;
|
ESM::Static record;
|
||||||
setting.mId = it->first;
|
record.mId = params.first;
|
||||||
setting.mValue = it->second;
|
record.mModel = params.second;
|
||||||
mStore.insertStatic(setting);
|
mStore.insertStatic(record);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<std::string, std::string> doors;
|
||||||
|
doors["prisonmarker"] = "marker_prison.nif";
|
||||||
|
|
||||||
|
for (const std::pair<std::string, std::string> ¶ms : doors)
|
||||||
|
{
|
||||||
|
if (!mStore.get<ESM::Door>().search(params.first))
|
||||||
|
{
|
||||||
|
ESM::Door record;
|
||||||
|
record.mId = params.first;
|
||||||
|
record.mModel = params.second;
|
||||||
|
mStore.insertStatic(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue