mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 11:23:51 +00:00
Search exterior cells in reverse (workaround for duplicate chargen_plank reference in Morrowind.esm and Bloodmoon.esm)
This commit is contained in:
parent
65e36793fc
commit
f929004635
2 changed files with 11 additions and 16 deletions
|
@ -193,8 +193,10 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then check cells that are already listed
|
// Then check cells that are already listed
|
||||||
for (std::map<std::pair<int, int>, CellStore>::iterator iter = mExteriors.begin();
|
// Search in reverse, this is a workaround for an ambiguous chargen_plank reference in the vanilla game.
|
||||||
iter!=mExteriors.end(); ++iter)
|
// there is one at -22,16 and one at -2,-9, the latter should be used.
|
||||||
|
for (std::map<std::pair<int, int>, CellStore>::reverse_iterator iter = mExteriors.rbegin();
|
||||||
|
iter!=mExteriors.rend(); ++iter)
|
||||||
{
|
{
|
||||||
Ptr ptr = getPtrAndCache (name, iter->second);
|
Ptr ptr = getPtrAndCache (name, iter->second);
|
||||||
if (!ptr.isEmpty())
|
if (!ptr.isEmpty())
|
||||||
|
|
|
@ -552,23 +552,16 @@ namespace MWWorld
|
||||||
template <>
|
template <>
|
||||||
class Store<ESM::Cell> : public StoreBase
|
class Store<ESM::Cell> : public StoreBase
|
||||||
{
|
{
|
||||||
struct ExtCmp
|
|
||||||
{
|
|
||||||
bool operator()(const ESM::Cell &x, const ESM::Cell &y) {
|
|
||||||
if (x.mData.mX == y.mData.mX) {
|
|
||||||
return x.mData.mY < y.mData.mY;
|
|
||||||
}
|
|
||||||
return x.mData.mX < y.mData.mX;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct DynamicExtCmp
|
struct DynamicExtCmp
|
||||||
{
|
{
|
||||||
bool operator()(const std::pair<int, int> &left, const std::pair<int, int> &right) const {
|
bool operator()(const std::pair<int, int> &left, const std::pair<int, int> &right) const {
|
||||||
if (left.first == right.first) {
|
if (left.first == right.first && left.second == right.second)
|
||||||
return left.second < right.second;
|
return false;
|
||||||
}
|
|
||||||
return left.first < right.first;
|
if (left.first == right.first)
|
||||||
|
return left.second > right.second;
|
||||||
|
|
||||||
|
return left.first > right.first;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue