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:
Michael Flaherty
2018-08-11 13:31:33 +01:00
committed by Asher Baker
parent 7e3b1c395b
commit a65c215217
+5 -2
View File
@@ -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;
}