Skip to content

Commit

Permalink
still call callback on network error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Aug 17, 2023
1 parent 408d5cd commit 4925750
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cheevos/cheevos_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,14 @@ static void rcheevos_async_end_request(rcheevos_async_io_request* request)
{
rc_api_destroy_request(&request->request);

if (request->callback && !rcheevos_load_aborted())
request->callback(request->callback_data);
if (request->callback) {
/* don't call the callback if the load was aborted
* (unless it was aborted by a network error) */
if (!rcheevos_load_aborted() ||
rcheevos_locals.load_info.state == RCHEEVOS_LOAD_STATE_NETWORK_ERROR) {
request->callback(request->callback_data);
}
}

/* rich presence request will be reused on next ping - reset the attempt
* counter. for all other request types, free the request object */
Expand Down

0 comments on commit 4925750

Please sign in to comment.