Fix DataPack Overwrite Regression (#862)
Some tests passed with the implementation prior to this commit, but those were edge cases. Good older behavior is now fully restored
This commit is contained in:
parent
7e3b1c395b
commit
a65c215217
@ -219,12 +219,16 @@ bool CDataPack::RemoveItem(size_t pos)
|
||||
{
|
||||
pos = position;
|
||||
}
|
||||
|
||||
if (pos >= elements.length())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pos < position) // we're deleting under us, step back
|
||||
{
|
||||
--position;
|
||||
}
|
||||
|
||||
switch (elements[pos].type)
|
||||
{
|
||||
case CDataPackType::Raw:
|
||||
@ -241,6 +245,5 @@ bool CDataPack::RemoveItem(size_t pos)
|
||||
}
|
||||
|
||||
elements.remove(pos);
|
||||
--position;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user