Fix wrong session index + save file corruption

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2025-12-06 14:25:01 +01:00
parent a9ff0a6d07
commit e6966a628c
5 changed files with 26 additions and 3 deletions

View File

@@ -238,7 +238,12 @@ pub fn tryMigrateIniSaveFile(allocator: std.mem.Allocator, save_ini: *ini.Ini(Ol
if (std.mem.eql(u8, user, username)) saved_users.last_username_index = i;
}
try saved_users.user_list.append(allocator, .{ .username = username, .session_index = save.session_index orelse 0 });
try saved_users.user_list.append(allocator, .{
.username = username,
.session_index = save.session_index orelse 0,
.first_run = false,
.allocated_username = false,
});
}
return true;