Merge branch 'no_at_boundaries' into 'master'

Don't use at() instead [] when length is checked/known

See merge request OpenMW/openmw!866
pull/593/head
Frederic Chardon 4 years ago
commit 62c7adc87b

@ -417,7 +417,7 @@ namespace MWRender
{ {
try try
{ {
unsigned int index = cell->mContextList.at(i).index; unsigned int index = cell->mContextList[i].index;
if (esm.size()<=index) if (esm.size()<=index)
esm.resize(index+1); esm.resize(index+1);
cell->restore(esm[index], i); cell->restore(esm[index], i);

@ -547,7 +547,7 @@ namespace MWWorld
try try
{ {
// Reopen the ESM reader and seek to the right position. // Reopen the ESM reader and seek to the right position.
int index = mCell->mContextList.at(i).index; int index = mCell->mContextList[i].index;
mCell->restore (esm[index], i); mCell->restore (esm[index], i);
ESM::CellRef ref; ESM::CellRef ref;
@ -606,7 +606,7 @@ namespace MWWorld
try try
{ {
// Reopen the ESM reader and seek to the right position. // Reopen the ESM reader and seek to the right position.
int index = mCell->mContextList.at(i).index; int index = mCell->mContextList[i].index;
mCell->restore (esm[index], i); mCell->restore (esm[index], i);
ESM::CellRef ref; ESM::CellRef ref;

@ -1003,7 +1003,7 @@ namespace MWWorld
if (index >= mStatic.size()) { if (index >= mStatic.size()) {
return nullptr; return nullptr;
} }
return &mStatic.at(index); return &mStatic[index];
} }
const ESM::Attribute *Store<ESM::Attribute>::find(size_t index) const const ESM::Attribute *Store<ESM::Attribute>::find(size_t index) const

Loading…
Cancel
Save