From d106c0a3299c3db59d4d019f8112c47bb3da8280 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 19 Dec 2022 19:52:53 +0000 Subject: [PATCH 1/5] Add TESTERS and HOSTTESTERS builds to CMake options --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 61e5ff86f..a99bd2f41 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -482,6 +482,12 @@ target_compile_definitions(SRB2SDL2 PRIVATE -DCMAKECONFIG) if(SRB2_CONFIG_DEBUGMODE) target_compile_definitions(SRB2SDL2 PRIVATE -DZDEBUG -DPARANOIA -DRANGECHECK -DPACKETDROP) endif() +if(SRB2_CONFIG_TESTERS) + target_compile_definitions(SRB2SDL2 PRIVATE -DTESTERS) +endif() +if(SRB2_CONFIG_HOSTTESTERS) + target_compile_definitions(SRB2SDL2 PRIVATE -DHOSTTESTERS) +endif() if(SRB2_CONFIG_MOBJCONSISTANCY) target_compile_definitions(SRB2SDL2 PRIVATE -DMOBJCONSISTANCY) endif() From 0214f62057635e0cff98c47fc8e1664ac7713243 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 19 Dec 2022 21:47:37 +0000 Subject: [PATCH 2/5] Add descriptions for TESTERS and HOSTTESTERS builds. --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0841f3b03..93176024d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -153,6 +153,10 @@ set(SRB2_CONFIG_YASM OFF CACHE BOOL "Use YASM in place of NASM.") set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL "Compile a development build of SRB2Kart.") +set(SRB2_CONFIG_TESTERS OFF CACHE BOOL + "Compile a build for testers.") +set(SRB2_CONFIG_HOSTTESTERS OFF CACHE BOOL + "Compile a build to host netgames for testers builds.") add_subdirectory(blua) From c89fb1539953db1e17e42bc58d77340ddf5db82c Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 19 Dec 2022 21:48:19 +0000 Subject: [PATCH 3/5] Use our updated name where appropriate. (text strings only) --- src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93176024d..318c9cb7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -152,7 +152,7 @@ set(SRB2_CONFIG_USEASM OFF CACHE BOOL set(SRB2_CONFIG_YASM OFF CACHE BOOL "Use YASM in place of NASM.") set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL - "Compile a development build of SRB2Kart.") + "Compile a development build of Dr Robotnik's Ring Racers.") set(SRB2_CONFIG_TESTERS OFF CACHE BOOL "Compile a build for testers.") set(SRB2_CONFIG_HOSTTESTERS OFF CACHE BOOL @@ -240,7 +240,7 @@ if(${SRB2_CONFIG_HAVE_ZLIB}) set(SRB2_HAVE_ZLIB ON) target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_ZLIB) else() - message(WARNING "You have specified that ZLIB is available but it was not found. SRB2Kart may not compile correctly.") + message(WARNING "You have specified that ZLIB is available but it was not found. Dr Robotnik's Ring Racers may not compile correctly.") endif() endif() @@ -263,7 +263,7 @@ if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB}) target_compile_definitions(SRB2SDL2 PRIVATE -D_LARGEFILE64_SOURCE) target_sources(SRB2SDL2 PRIVATE apng.c) else() - message(WARNING "You have specified that PNG is available but it was not found. SRB2Kart may not compile correctly.") + message(WARNING "You have specified that PNG is available but it was not found. Dr Robotnik's Ring Racers may not compile correctly.") endif() endif() endif() From a29d43d3b5a4453b0cd012ffba2e9b2ec727a3b8 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 21 Dec 2022 22:45:42 -0800 Subject: [PATCH 4/5] Restore save_p after P_LoadLevel P_LoadLevel calls some functions that save gamedata and unset save_p. --- src/p_saveg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index f36d94319..7fb110e49 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -4867,6 +4867,7 @@ static inline boolean P_NetUnArchiveMisc(boolean reloading) { size_t i, j; size_t numTasks; + UINT8 *old_save_p; if (READUINT32(save_p) != ARCHIVEBLOCK_MISC) I_Error("Bad $$$.sav at archive block Misc"); @@ -4909,12 +4910,17 @@ static inline boolean P_NetUnArchiveMisc(boolean reloading) encoremode = (boolean)READUINT8(save_p); + // FIXME: save_p should not be global!!! + old_save_p = save_p; + if (!P_LoadLevel(true, reloading)) { CONS_Alert(CONS_ERROR, M_GetText("Can't load the level!\n")); return false; } + save_p = old_save_p; + // get the time leveltime = READUINT32(save_p); lastmap = READINT16(save_p); From 90903e999fb801d0021764de593a08cc72a09428 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 21 Dec 2022 23:17:49 -0800 Subject: [PATCH 5/5] Fix MAXAVAILABILITY loop --- src/p_saveg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 7fb110e49..e9b5b237e 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -521,7 +521,7 @@ static void P_NetUnArchivePlayers(void) players[i].skincolor = READUINT8(save_p); players[i].skin = READINT32(save_p); - for (j = 0; i < MAXAVAILABILITY; j++) + for (j = 0; j < MAXAVAILABILITY; j++) { players[i].availabilities[j] = READUINT8(save_p); }