From 35666e21aeba7adaf11771e2912c0c08f3616a18 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Mon, 3 Oct 2016 08:47:47 -0400 Subject: [PATCH] Reimplemented savestate task informing Netplay --- tasks/task_save.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tasks/task_save.c b/tasks/task_save.c index aea60c802d..d97a68a22c 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -38,6 +38,10 @@ #include "../core.h" #endif +#ifdef HAVE_NETWORKING +#include "network/netplay/netplay.h" +#endif + #include "../core.h" #include "../file_path_special.h" #include "../configuration.h" @@ -431,6 +435,12 @@ bool content_undo_load_state(void) ret = core_unserialize(&serial_info); +#if HAVE_NETWORKING + /* If Netplay is running, inform it */ + if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL)) + netplay_driver_ctl(RARCH_NETPLAY_CTL_LOAD_SAVESTATE, &serial_info); +#endif + /* Clean up the temporary copy */ free(temp_data); temp_data = NULL; @@ -878,6 +888,12 @@ static void content_load_state_cb(void *task_data, ret = core_unserialize(&serial_info); +#if HAVE_NETWORKING + /* If Netplay is running, inform it */ + if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL)) + netplay_driver_ctl(RARCH_NETPLAY_CTL_LOAD_SAVESTATE, &serial_info); +#endif + /* Flush back. */ for (i = 0; i < num_blocks; i++) {