From 01035c895a18bcffc259efd483f7aeca0f0ca45b Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Thu, 25 Aug 2022 20:33:47 -0400 Subject: [PATCH] Small bug fixes to Stop Hosting (#161) Previously you could exit during the act select screen and even crash the game by entering a door and then pressing Stop Host. --- src/game/level_update.c | 2 +- src/pc/djui/djui_panel_pause.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/game/level_update.c b/src/game/level_update.c index 498f08560..033a5140a 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -20,7 +20,7 @@ #include "object_list_processor.h" #include "ingame_menu.h" #include "obj_behaviors.h" -#include "game/object_helpers.h" +#include "object_helpers.h" #include "save_file.h" #include "hardcoded.h" #include "debug_course.h" diff --git a/src/pc/djui/djui_panel_pause.c b/src/pc/djui/djui_panel_pause.c index 43b7dfbca..e41a605d0 100644 --- a/src/pc/djui/djui_panel_pause.c +++ b/src/pc/djui/djui_panel_pause.c @@ -1,7 +1,10 @@ #include "djui.h" #include "pc/cheats.h" -#include "src/pc/pc_main.h" -#include "src/pc/network/network.h" +#include "pc/pc_main.h" +#include "pc/network/network.h" +#include "game/object_helpers.h" +#include "behavior_table.h" +#include "sm64.h" bool gDjuiPanelPauseCreated = false; @@ -14,6 +17,8 @@ static void djui_panel_pause_quit_yes(UNUSED struct DjuiBase* caller) { } static void djui_panel_pause_quit(struct DjuiBase* caller) { + if (find_object_with_behavior(bhvActSelector) != NULL || gMarioStates[0].action == ACT_PUSHING_DOOR || gMarioStates[0].action == ACT_PULLING_DOOR) { return; } + if (gNetworkType == NT_SERVER) { djui_panel_confirm_create(caller, "\\#ff0800\\Q\\#1be700\\U\\#00b3ff\\I\\#ffef00\\T",