mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Merge pull request #2000 from Capostrophic/prisonmarker
Add prison marker record fallback definition (bug #4701)
This commit is contained in:
commit
376599533b
5 changed files with 66 additions and 12 deletions
|
@ -2,6 +2,7 @@
|
|||
------
|
||||
|
||||
Bug #4540: Rain delay when exiting water
|
||||
Bug #4701: PrisonMarker record is not hardcoded like other markers
|
||||
Feature #2229: Improve pathfinding AI
|
||||
Feature #3442: Default values for fallbacks from ini file
|
||||
Feature #4673: Weapon sheathing
|
||||
|
|
|
@ -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…
Reference in a new issue