mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
fixed an indexing problem in IdCollection
This commit is contained in:
parent
2c1796cc74
commit
e7bf1d230c
1 changed files with 9 additions and 3 deletions
|
@ -278,9 +278,15 @@ namespace CSMWorld
|
|||
template<typename ESXRecordT, typename IdAccessorT>
|
||||
void IdCollection<ESXRecordT, IdAccessorT>::purge()
|
||||
{
|
||||
mRecords.erase (std::remove_if (mRecords.begin(), mRecords.end(),
|
||||
std::mem_fun_ref (&Record<ESXRecordT>::isErased) // I want lambda :(
|
||||
), mRecords.end());
|
||||
int i = 0;
|
||||
|
||||
while (i<static_cast<int> (mRecords.size()))
|
||||
{
|
||||
if (mRecords[i].isErased())
|
||||
removeRows (i, 1);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ESXRecordT, typename IdAccessorT>
|
||||
|
|
Loading…
Reference in a new issue