Skip to content

Commit

Permalink
Add version check to parse medium plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Silarn committed Jun 11, 2024
1 parent 6eb6244 commit 8ca6b82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/starfieldsavegame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ std::unique_ptr<GamebryoSaveGame::DataFields> StarfieldSaveGame::fetchDataFields
QString ignore;
std::unique_ptr<DataFields> fields = std::make_unique<DataFields>();

uint8_t saveGameVersion = file.readChar(12);
file.readChar(12);
file.read(ignore); // game version
file.read(ignore); // game version again?
file.readInt(); // plugin info size

fields->Plugins = file.readPlugins(0, extraInfo, gamePlugins);
fields->LightPlugins = file.readLightPlugins(0, extraInfo, gamePlugins);
fields->MediumPlugins = file.readMediumPlugins(0, extraInfo, gamePlugins);
fields->Plugins = file.readPlugins(0, extraInfo, gamePlugins);
fields->LightPlugins = file.readLightPlugins(0, extraInfo, gamePlugins);
if (saveVersion >= 122)
fields->MediumPlugins = file.readMediumPlugins(0, extraInfo, gamePlugins);
file.closeCompressedData();
file.close();

Expand Down

0 comments on commit 8ca6b82

Please sign in to comment.