mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +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
@ -193,8 +193,10 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name)
|
||||
}
|
||||
|
||||
// Then check cells that are already listed
|
||||
for (std::map<std::pair<int, int>, CellStore>::iterator iter = mExteriors.begin();
|
||||
iter!=mExteriors.end(); ++iter)
|
||||
// Search in reverse, this is a workaround for an ambiguous chargen_plank reference in the vanilla game.
|
||||
// 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);
|
||||
if (!ptr.isEmpty())
|
||||
|
@ -552,23 +552,16 @@ namespace MWWorld
|
||||
template <>
|
||||
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
|
||||
{
|
||||
bool operator()(const std::pair<int, int> &left, const std::pair<int, int> &right) const {
|
||||
if (left.first == right.first) {
|
||||
return left.second < right.second;
|
||||
}
|
||||
return left.first < right.first;
|
||||
if (left.first == right.first && left.second == right.second)
|
||||
return false;
|
||||
|
||||
if (left.first == right.first)
|
||||
return left.second > right.second;
|
||||
|
||||
return left.first > right.first;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user