FINALLY fix --server

This commit is contained in:
Agent X 2024-03-09 21:35:54 -05:00
parent 021fd1f621
commit 74dd416749
1 changed files with 2 additions and 9 deletions

View File

@ -331,6 +331,7 @@ void* main_game_init(UNUSED void* arg) {
gGameInited = true;
}
extern void djui_panel_do_host(bool reconnecting);
int main(int argc, char *argv[]) {
// Handle terminal arguments
@ -385,15 +386,7 @@ int main(int argc, char *argv[]) {
} else if (gCLIOpts.Network == NT_SERVER) {
network_set_system(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;
network_init(NT_SERVER, false);
djui_panel_shutdown();
djui_panel_modlist_create(NULL);
djui_panel_do_host(NULL);
} else {
network_init(NT_NONE, false);
}