Add prison marker record fallback definition (bug #4701)

pull/2000/head
Capostrophic 6 years ago
parent c114e1278e
commit 4efe1bc892

@ -1,6 +1,7 @@
0.46.0
------
Bug #4701: PrisonMarker record is not hardcoded like other markers
Feature #2229: Improve pathfinding AI
Feature #3442: Default values for fallbacks from ini file
Task #4686: Upgrade media decoder to a more current FFmpeg API

@ -977,15 +977,19 @@ int CSMWorld::Data::startLoading (const boost::filesystem::path& path, bool base
void CSMWorld::Data::loadFallbackEntries()
{
// 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")
std::pair<std::string, std::string> staticMarkers[] = {
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)
std::pair<std::string, std::string> doorMarkers[] = {
std::make_pair("PrisonMarker", "marker_prison.nif")
};
for (const std::pair<std::string, std::string> marker : staticMarkers)
{
if (mReferenceables.searchId (marker.first)==-1)
{
@ -995,6 +999,17 @@ void CSMWorld::Data::loadFallbackEntries()
mReferenceables.appendRecord (record, CSMWorld::UniversalId::Type_Static);
}
}
for (const std::pair<std::string, std::string> marker : doorMarkers)
{
if (mReferenceables.searchId (marker.first)==-1)
{
CSMWorld::Record<ESM::Door> record;
record.mBase = ESM::Door(marker.first, std::string(), marker.second, std::string(), std::string(), std::string());
record.mState = CSMWorld::RecordBase::State_BaseOnly;
mReferenceables.appendRecord (record, CSMWorld::UniversalId::Type_Door);
}
}
}
bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)

@ -141,6 +141,7 @@ void ESMStore::setUp(bool validateRecords)
mAttributes.setUp();
mDialogs.setUp();
mStatics.setUp();
mDoors.setUp();
if (validateRecords)
validate();

@ -1059,11 +1059,11 @@ namespace MWWorld
{
// 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")
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)
@ -1080,6 +1080,28 @@ namespace MWWorld
}
}
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 = ESM::Door(marker.first, std::string(), marker.second, std::string(), std::string(), std::string());
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 <>
inline RecordId Store<ESM::Dialogue>::load(ESM::ESMReader &esm) {
// The original letter case of a dialogue ID is saved, because it's printed

@ -22,6 +22,21 @@ struct Door
void blank();
///< Set record to default state (does not touch the ID).
Door(const std::string id, const std::string name, const std::string &model,
const std::string script, const std::string opensound, const std::string closesound)
: mId(id)
, mName(name)
, mModel(model)
, mScript(script)
, mOpenSound(opensound)
, mCloseSound(closesound)
{
}
Door()
{
}
};
}
#endif

Loading…
Cancel
Save