mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
fixed an indexing problem in IdCollection
This commit is contained in:
parent
2c1796cc74
commit
e7bf1d230c
@ -278,9 +278,15 @@ namespace CSMWorld
|
|||||||
template<typename ESXRecordT, typename IdAccessorT>
|
template<typename ESXRecordT, typename IdAccessorT>
|
||||||
void IdCollection<ESXRecordT, IdAccessorT>::purge()
|
void IdCollection<ESXRecordT, IdAccessorT>::purge()
|
||||||
{
|
{
|
||||||
mRecords.erase (std::remove_if (mRecords.begin(), mRecords.end(),
|
int i = 0;
|
||||||
std::mem_fun_ref (&Record<ESXRecordT>::isErased) // I want lambda :(
|
|
||||||
), mRecords.end());
|
while (i<static_cast<int> (mRecords.size()))
|
||||||
|
{
|
||||||
|
if (mRecords[i].isErased())
|
||||||
|
removeRows (i, 1);
|
||||||
|
else
|
||||||
|
++i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ESXRecordT, typename IdAccessorT>
|
template<typename ESXRecordT, typename IdAccessorT>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user