From bf64b954165fb42668746aa0a9a666a820a7ddb2 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 2 Aug 2020 20:35:00 -0700 Subject: [PATCH] Ifdef out network code for M&P M&P contains network code despite M&P not being a Steam/GOG release (as Steam/GOG releases are full releases of the game, not custom-levels-only releases). While unlocking achievements is already ifdef'd out in M&P, let's remove the network code entirely to make sure people can't do other shenanigans with M&P builds, and also to have a smaller binary size. --- desktop_version/src/GOGNetwork.c | 6 ++++++ desktop_version/src/Network.c | 11 +++++++++++ desktop_version/src/SteamNetwork.c | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/desktop_version/src/GOGNetwork.c b/desktop_version/src/GOGNetwork.c index b3d72b4c..9755fa4b 100644 --- a/desktop_version/src/GOGNetwork.c +++ b/desktop_version/src/GOGNetwork.c @@ -1,3 +1,7 @@ +#include "MakeAndPlay.h" + +#ifndef MAKEANDPLAY + #include /* Totally unimplemented right now! */ @@ -27,3 +31,5 @@ int32_t GOG_getAchievementProgress(const char *name) void GOG_setAchievementProgress(const char *name, int32_t stat) { } + +#endif /* MAKEANDPLAY */ diff --git a/desktop_version/src/Network.c b/desktop_version/src/Network.c index 15937a81..a6e0c00b 100644 --- a/desktop_version/src/Network.c +++ b/desktop_version/src/Network.c @@ -1,7 +1,18 @@ #include +#include "MakeAndPlay.h" + #define UNUSED(expr) (void)(expr) +#ifdef MAKEANDPLAY + #ifdef STEAM_NETWORK + #undef STEAM_NETWORK + #endif + #ifdef GOG_NETWORK + #undef GOG_NETWORK + #endif +#endif + #ifdef STEAM_NETWORK #define STEAM_NUM 1 #else diff --git a/desktop_version/src/SteamNetwork.c b/desktop_version/src/SteamNetwork.c index 892d85ab..87afa397 100644 --- a/desktop_version/src/SteamNetwork.c +++ b/desktop_version/src/SteamNetwork.c @@ -1,3 +1,7 @@ +#include "MakeAndPlay.h" + +#ifndef MAKEANDPLAY + #include #include #include @@ -218,3 +222,5 @@ void STEAM_setAchievementProgress(const char *name, int32_t stat) SteamAPI_ISteamUserStats_StoreStats(steamUserStats); } } + +#endif /* MAKEANDPLAY */