Reverse file iteration in the Steam storage
This prevents us from skipping files if they are deleted from within the callback.
This commit is contained in:
@@ -105,7 +105,7 @@ static bool STEAM_EnumerateStorageDirectory(void *userdata, const char *path, SD
|
|||||||
|
|
||||||
bool done = false;
|
bool done = false;
|
||||||
Sint32 count = steam->SteamAPI_ISteamRemoteStorage_GetFileCount(steamremotestorage);
|
Sint32 count = steam->SteamAPI_ISteamRemoteStorage_GetFileCount(steamremotestorage);
|
||||||
for (Sint32 i = 0; i < count && !done; ++i) {
|
for (Sint32 i = count; i-- && !done; ) {
|
||||||
const char *file = steam->SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(steamremotestorage, i, NULL);
|
const char *file = steam->SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(steamremotestorage, i, NULL);
|
||||||
if (!file) {
|
if (!file) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user