From 4fc0cc92e69d17b7b1600f39013f846116a59ac8 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Sun, 12 May 2024 22:58:43 +1000 Subject: [PATCH] fix headless servers with mods that access marioObj on load (#37) --- src/pc/pc_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index 84e2e092..36adbe07 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -435,6 +435,11 @@ int main(int argc, char *argv[]) { configNetworkSystem = NS_SOCKET; configHostPort = gCLIOpts.networkPort; + // Horrible, hacky fix for mods that access marioObj straight away + // best fix: host with the standard main menu method + static struct Object sHackyObject = { 0 }; + gMarioStates[0].marioObj = &sHackyObject; + extern void djui_panel_do_host(bool reconnecting, bool playSound); djui_panel_do_host(NULL, false); } else {