mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Merge pull request #2267 from pyroesp/Add_File_Check
Added file check before loading game
This commit is contained in:
commit
4b68a6b853
10
retroarch.c
10
retroarch.c
@ -46,6 +46,7 @@
|
|||||||
#include "performance.h"
|
#include "performance.h"
|
||||||
#include "cheats.h"
|
#include "cheats.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
#include "retro_file.h"
|
||||||
|
|
||||||
#include "git_version.h"
|
#include "git_version.h"
|
||||||
|
|
||||||
@ -1495,6 +1496,15 @@ void rarch_playlist_load_content(void *data, unsigned idx)
|
|||||||
content_playlist_get_index(playlist,
|
content_playlist_get_index(playlist,
|
||||||
idx, &path, NULL, &core_path, NULL, NULL, NULL);
|
idx, &path, NULL, &core_path, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
RFILE *fp = retro_fopen(path, RFILE_MODE_READ, -1);
|
||||||
|
if (!fp)
|
||||||
|
{
|
||||||
|
rarch_main_msg_queue_push("File could not be loaded.\n", 1, 100, true);
|
||||||
|
RARCH_LOG("File at %s failed to load.\n", path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
retro_fclose(fp);
|
||||||
|
|
||||||
strlcpy(settings->libretro, core_path, sizeof(settings->libretro));
|
strlcpy(settings->libretro, core_path, sizeof(settings->libretro));
|
||||||
|
|
||||||
if (menu)
|
if (menu)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user