Off by one error - can't delete the last element of a refid collection.

test
cc9cii 10 years ago
parent 6fcf4ea9e3
commit a6925683c6

@ -130,7 +130,7 @@ namespace CSMWorld
template<typename RecordT> template<typename RecordT>
void RefIdDataContainer<RecordT>::erase (int index, int count) void RefIdDataContainer<RecordT>::erase (int index, int count)
{ {
if (index<0 || index+count>=getSize()) if (index<0 || index+count>getSize())
throw std::runtime_error ("invalid RefIdDataContainer index"); throw std::runtime_error ("invalid RefIdDataContainer index");
mContainer.erase (mContainer.begin()+index, mContainer.begin()+index+count); mContainer.erase (mContainer.begin()+index, mContainer.begin()+index+count);

Loading…
Cancel
Save