Merge pull request #4596 from leiradel/master
Fixed crash in cheevos_get_description
This commit is contained in:
commit
8d2bafb279
|
@ -3227,15 +3227,23 @@ void cheevos_populate_menu(void *data, bool hardcore)
|
|||
|
||||
bool cheevos_get_description(cheevos_ctx_desc_t *desc)
|
||||
{
|
||||
cheevo_t *cheevos = cheevos_locals.core.cheevos;
|
||||
|
||||
if (desc->idx >= cheevos_locals.core.count)
|
||||
if (cheevos_loaded)
|
||||
{
|
||||
cheevos = cheevos_locals.unofficial.cheevos;
|
||||
desc->idx -= cheevos_locals.unofficial.count;
|
||||
cheevo_t *cheevos = cheevos_locals.core.cheevos;
|
||||
|
||||
if (desc->idx >= cheevos_locals.core.count)
|
||||
{
|
||||
cheevos = cheevos_locals.unofficial.cheevos;
|
||||
desc->idx -= cheevos_locals.unofficial.count;
|
||||
}
|
||||
|
||||
strlcpy(desc->s, cheevos[desc->idx].description, desc->len);
|
||||
}
|
||||
else
|
||||
{
|
||||
*desc->s = 0;
|
||||
}
|
||||
|
||||
strlcpy(desc->s, cheevos[desc->idx].description, desc->len);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue