Skip to content

Commit

Permalink
fix savegame slot indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
Keiichi86 committed Aug 3, 2024
1 parent 3524da9 commit 3d77daf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/extensions/Configs/FastLoader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ inline struct FastLoaderConfig {
bool StartGame(int32 slot) {
const auto CheckIfSaveFileExists = [](int32 slot) {
CFileMgr::SetDirMyDocuments();
const bool exists = std::filesystem::exists(std::format("GTASAsf{}.b", slot));
const bool exists = std::filesystem::exists(std::format("GTASAsf{}.b", slot + 1));
CFileMgr::ChangeDir("");
return exists;
};

if (slot == -1) { // Find first valid slot and load that
for (auto i = 1u; i <= MAX_SAVEGAME_SLOTS; i++) {
for (auto i = 0u; i <= MAX_SAVEGAME_SLOTS; i++) {
if (CheckIfSaveFileExists(i)) {
return StartGame(i); // Load this slot
}
Expand All @@ -55,7 +55,6 @@ inline struct FastLoaderConfig {
}

// Load game from slot
assert(slot > 0);
if (!CheckIfSaveFileExists(slot)) {
NOTSA_LOG_WARN("Save slot {} is empty!", slot);
return false;
Expand Down

0 comments on commit 3d77daf

Please sign in to comment.