From a091ccca934dcf7bc16695f8cb9b747ed09972d2 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 7 Nov 2023 14:57:42 -0800 Subject: [PATCH] Made soft-resetting of the camera no longer change camera position --- src/game/camera.c | 14 +++++++------- src/pc/djui/djui_chat_box.c | 10 ++++++---- src/pc/pc_main.c | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/game/camera.c b/src/game/camera.c index d23d3bf5..ea435ef3 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -3609,13 +3609,13 @@ void init_camera(struct Camera *c) { if (sSoftResettingCamera) { c->cutscene = 0; sSoftResettingCamera = FALSE; - } - - // Set the camera pos to marioOffset (relative to Mario), added to Mario's position - offset_rotated(c->pos, sMarioCamState->pos, marioOffset, sMarioCamState->faceAngle); - if (c->mode != CAMERA_MODE_BEHIND_MARIO) { - c->pos[1] = find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 100.f, - sMarioCamState->pos[2], &floor) + 125.f; + } else { + // Set the camera pos to marioOffset (relative to Mario), added to Mario's position + offset_rotated(c->pos, sMarioCamState->pos, marioOffset, sMarioCamState->faceAngle); + if (c->mode != CAMERA_MODE_BEHIND_MARIO) { + c->pos[1] = find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 100.f, + sMarioCamState->pos[2], &floor) + 125.f; + } } vec3f_copy(c->focus, sMarioCamState->pos); vec3f_copy(gLakituState.curPos, c->pos); diff --git a/src/pc/djui/djui_chat_box.c b/src/pc/djui/djui_chat_box.c index 2cddff78..e1b98d74 100644 --- a/src/pc/djui/djui_chat_box.c +++ b/src/pc/djui/djui_chat_box.c @@ -459,11 +459,13 @@ static bool djui_chat_box_input_on_key_down(struct DjuiBase* base, int scancode) djui_chat_box_input_escape(gDjuiChatBox->chatInput); return true; default: - bool returnValueOnOtherKeyDown = djui_inputbox_on_key_down(base, scancode); - if (strcmp(previousText, gDjuiChatBox->chatInput->buffer) != 0) { - reset_tab_completion_all(); + { + bool returnValueOnOtherKeyDown = djui_inputbox_on_key_down(base, scancode); + if (strcmp(previousText, gDjuiChatBox->chatInput->buffer) != 0) { + reset_tab_completion_all(); + } + return returnValueOnOtherKeyDown; } - return returnValueOnOtherKeyDown; } } diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index b58be411..f9fbf129 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -254,7 +254,7 @@ void game_exit(void) { exit(0); } -void *main_game_init(void*) { +void* main_game_init(UNUSED void* arg) { const char *gamedir = gCLIOpts.GameDir[0] ? gCLIOpts.GameDir : FS_BASEDIR; const char *userpath = gCLIOpts.SavePath[0] ? gCLIOpts.SavePath : sys_user_path(); fs_init(sys_ropaths, gamedir, userpath);