From 45ea76859004c39e429bec2d9627176014dfeb49 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:51:44 +1000 Subject: [PATCH] a few adjustments to merged prs --- src/pc/lua/utils/smlua_misc_utils.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/pc/lua/utils/smlua_misc_utils.c b/src/pc/lua/utils/smlua_misc_utils.c index 599262fe..0af4bd1c 100644 --- a/src/pc/lua/utils/smlua_misc_utils.c +++ b/src/pc/lua/utils/smlua_misc_utils.c @@ -27,12 +27,15 @@ #include "game/first_person_cam.h" #include "pc/lua/utils/smlua_math_utils.h" #include "pc/lua/utils/smlua_audio_utils.h" -#include "pc/network/socket/socket.h" #ifdef DISCORD_SDK #include "pc/discord/discord.h" #endif +#ifdef COOPNET +#include "pc/network/coopnet/coopnet.h" +#endif + static struct DateTime sDateTime; /// @@ -427,12 +430,16 @@ const char* get_local_discord_id(void) { #endif } -const char* get_coopnet_id(s8 localIndex) { - if (!gNetworkSystem || gNetworkSystem == &gNetworkSystemSocket) { return "-1"; } - if (localIndex < 0 || localIndex > MAX_PLAYERS - 1) { return "-1"; } +const char* get_coopnet_id(UNUSED s8 localIndex) { +#ifdef COOPNET + if (!gNetworkSystem || gNetworkSystem != &gNetworkSystemCoopNet) { return "-1"; } + if (localIndex < 0 || localIndex >= MAX_PLAYERS) { return "-1"; } struct NetworkPlayer* np = &gNetworkPlayers[localIndex]; if (np == NULL || !np->connected) { return "-1"; } return gNetworkSystem->get_id_str(np->localIndex); +#else + return "-1"; +#endif } ///