1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

If multiple plugins have land data for the same cell, the last plugin should win

This commit is contained in:
scrawl 2013-08-21 17:24:24 +02:00
parent 5f7e6f7b10
commit 758d989a03

View File

@ -466,6 +466,18 @@ namespace MWWorld
ESM::Land *ptr = new ESM::Land();
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);
}