use default mapping if initializing map with no game loaded (#16396)

This commit is contained in:
Jamiras 2024-04-02 01:07:06 -06:00 committed by GitHub
parent 595f574f5c
commit a218c36a0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -216,11 +216,9 @@ static int rcheevos_init_memory(rcheevos_locals_t* locals)
unsigned console_id;
#ifdef HAVE_RC_CLIENT
/* we can't initialize memory without knowing which console to initialize for */
/* if no game is loaded, fallback to a default mapping (SYSTEM RAM followed by SAVE RAM) */
game = rc_client_get_game_info(locals->client);
if (!game || !game->console_id)
return 0;
console_id = game->console_id;
console_id = game ? game->console_id : 0;
#else
console_id = locals->game.console_id;
#endif