Issue with DiskSavedGameDataStorer
Posted: Sun Jul 29, 2018 6:27 am
Hi,
I think there might be a problem with DiskSavedGameDataStorer. It looks like it computes slot indices incorrectly for saveinfo.dat by using slotNumber - 1 when slotNumber is already zero-based (first save file name is save_0.dat), which causes an error when it tries to access index -1 in m_savedGameInfo.
Only noticed this after I switched from player prefs to DiskSavedGameDataStorer for debugging purposes. Have fixed it for now by not subtracting 1 in the methods UpdateSavedGameInfoToFile and HasDataInSlot, and it seems to work correctly now, but I'm a bit worried that it might break something else.
I think there might be a problem with DiskSavedGameDataStorer. It looks like it computes slot indices incorrectly for saveinfo.dat by using slotNumber - 1 when slotNumber is already zero-based (first save file name is save_0.dat), which causes an error when it tries to access index -1 in m_savedGameInfo.
Only noticed this after I switched from player prefs to DiskSavedGameDataStorer for debugging purposes. Have fixed it for now by not subtracting 1 in the methods UpdateSavedGameInfoToFile and HasDataInSlot, and it seems to work correctly now, but I'm a bit worried that it might break something else.