mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Merge pull request #8400 from fr500/master
fix discord launch arguments not working if RA was started from CWD o…
This commit is contained in:
commit
84d6f6231d
@ -448,6 +448,7 @@ void discord_update(enum discord_presence presence)
|
|||||||
|
|
||||||
void discord_init(void)
|
void discord_init(void)
|
||||||
{
|
{
|
||||||
|
char full_path[PATH_MAX_LENGTH];
|
||||||
char command[PATH_MAX_LENGTH];
|
char command[PATH_MAX_LENGTH];
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
@ -467,11 +468,17 @@ void discord_init(void)
|
|||||||
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 0, NULL);
|
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 0, NULL);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
strlcpy(command, get_retroarch_launch_arguments(), sizeof(command));
|
GetModuleFileNameA(NULL, full_path, sizeof(full_path));
|
||||||
|
if (strstr(get_retroarch_launch_arguments(), full_path))
|
||||||
|
strlcpy(command, get_retroarch_launch_arguments(), sizeof(command));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
path_basedir(full_path);
|
||||||
|
snprintf(command, sizeof(command), "%s%s", full_path, get_retroarch_launch_arguments());
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
snprintf(command, sizeof(command), "sh -c %s", get_retroarch_launch_arguments());
|
snprintf(command, sizeof(command), "sh -c %s", get_retroarch_launch_arguments());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RARCH_LOG("[discord] registering startup command: %s\n", command);
|
RARCH_LOG("[discord] registering startup command: %s\n", command);
|
||||||
Discord_Register(settings->arrays.discord_app_id, command);
|
Discord_Register(settings->arrays.discord_app_id, command);
|
||||||
discord_ready = true;
|
discord_ready = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user