forked from teamnwah/openmw-tes3coop
If multiple plugins have land data for the same cell, the last plugin should win
This commit is contained in:
parent
5f7e6f7b10
commit
758d989a03
1 changed files with 12 additions and 0 deletions
|
@ -466,6 +466,18 @@ namespace MWWorld
|
||||||
ESM::Land *ptr = new ESM::Land();
|
ESM::Land *ptr = new ESM::Land();
|
||||||
ptr->load(esm);
|
ptr->load(esm);
|
||||||
|
|
||||||
|
// Same area defined in multiple plugins? -> last plugin wins
|
||||||
|
// Can't use search() because we aren't sorted yet - is there any other way to speed this up?
|
||||||
|
for (std::vector<ESM::Land*>::iterator it = mStatic.begin(); it != mStatic.end(); ++it)
|
||||||
|
{
|
||||||
|
if ((*it)->mX == ptr->mX && (*it)->mY == ptr->mY)
|
||||||
|
{
|
||||||
|
delete *it;
|
||||||
|
mStatic.erase(it);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mStatic.push_back(ptr);
|
mStatic.push_back(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue