mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 07:06:43 +00:00
assert -> exception to gracefully handle corrupted savegames
This commit is contained in:
parent
368c868623
commit
ac8abd3398
1 changed files with 4 additions and 2 deletions
|
@ -296,7 +296,8 @@ void LocalMap::requestMap(MWWorld::CellStore* cell,
|
||||||
ESM::FogState* fog = cell->getFog();
|
ESM::FogState* fog = cell->getFog();
|
||||||
|
|
||||||
// We are using the same bounds and angle as we were using when the textures were originally made. Segments should come out the same.
|
// We are using the same bounds and angle as we were using when the textures were originally made. Segments should come out the same.
|
||||||
assert (i < int(fog->mFogTextures.size()));
|
if (i >= int(fog->mFogTextures.size()))
|
||||||
|
throw std::runtime_error("fog texture count mismatch");
|
||||||
|
|
||||||
ESM::FogTexture& esm = fog->mFogTextures[i];
|
ESM::FogTexture& esm = fog->mFogTextures[i];
|
||||||
loadFogOfWar(texturePrefix, esm);
|
loadFogOfWar(texturePrefix, esm);
|
||||||
|
@ -351,7 +352,8 @@ void LocalMap::loadFogOfWar (const std::string& texturePrefix, ESM::FogTexture&
|
||||||
Ogre::Image image;
|
Ogre::Image image;
|
||||||
image.load(stream, "tga");
|
image.load(stream, "tga");
|
||||||
|
|
||||||
assert (image.getWidth() == sFogOfWarResolution && image.getHeight() == sFogOfWarResolution);
|
if (image.getWidth() != sFogOfWarResolution || image.getHeight() != sFogOfWarResolution)
|
||||||
|
throw std::runtime_error("fog texture size mismatch");
|
||||||
|
|
||||||
std::string texName = texturePrefix + "_fog";
|
std::string texName = texturePrefix + "_fog";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue