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

This commit is contained in:
cc9cii 2015-04-25 06:04:39 +10:00
parent 6fcf4ea9e3
commit a6925683c6

View file

@ -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);