mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-17 01:10:10 +00:00
Avoid issues with saved games that have no screenshot data
This commit is contained in:
parent
20186fd2c2
commit
a8e561d885
@ -430,7 +430,13 @@ namespace MWGui
|
||||
|
||||
// Decode screenshot
|
||||
const std::vector<char>& data = mCurrentSlot->mProfile.mScreenshot;
|
||||
Files::IMemStream instream (&data[0], data.size());
|
||||
if (!data.size())
|
||||
{
|
||||
Log(Debug::Warning) << "Warning: Selected saved game has no savegame screenshot";
|
||||
return;
|
||||
}
|
||||
|
||||
Files::IMemStream instream (data.data(), data.size());
|
||||
|
||||
osgDB::ReaderWriter* readerwriter = osgDB::Registry::instance()->getReaderWriterForExtension("jpg");
|
||||
if (!readerwriter)
|
||||
|
@ -50,7 +50,7 @@ void SavedGame::save (ESMWriter &esm) const
|
||||
esm.writeHNString ("DEPE", *iter);
|
||||
|
||||
esm.startSubRecord("SCRN");
|
||||
esm.write(&mScreenshot[0], mScreenshot.size());
|
||||
esm.write(mScreenshot.data(), mScreenshot.size());
|
||||
esm.endRecord("SCRN");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user