fix the palette editor hat in hand outside menus (#81)

This commit is contained in:
Isaac0-dev 2024-06-27 11:53:54 +10:00 committed by GitHub
parent dc02aa9881
commit 838604a761
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -10874,7 +10874,7 @@ void cutscene_palette_editor(struct Camera *c) {
if (!pressed && m->action != ACT_TAKING_OFF_CAP && m->action != ACT_PUTTING_ON_CAP) { if (!pressed && m->action != ACT_TAKING_OFF_CAP && m->action != ACT_PUTTING_ON_CAP) {
if (m->flags & MARIO_CAP_ON_HEAD) { if (m->flags & MARIO_CAP_ON_HEAD) {
if (m->action == ACT_IDLE) { if (m->action == ACT_IDLE) {
set_mario_action(m, ACT_TAKING_OFF_CAP, 0); set_mario_action(m, ACT_TAKING_OFF_CAP, 1); // Add palette editor action arg
} else { } else {
cutscene_take_cap_off(m); cutscene_take_cap_off(m);
gCamera->paletteEditorCap = true; gCamera->paletteEditorCap = true;

View file

@ -1882,20 +1882,21 @@ s32 act_putting_on_cap(struct MarioState *m) {
} }
// coop custom action // coop custom action
// actionArg == 1: the action was inited from CUTSCENE_PALETTE_EDITOR
s32 act_taking_off_cap(struct MarioState *m) { s32 act_taking_off_cap(struct MarioState *m) {
s16 animFrame = set_character_animation(m, CHAR_ANIM_TAKE_CAP_OFF_THEN_ON); s16 animFrame = set_character_animation(m, CHAR_ANIM_TAKE_CAP_OFF_THEN_ON);
switch (animFrame) { switch (animFrame) {
case 0: case 0:
if (gCamera->cutscene != CUTSCENE_PALETTE_EDITOR) { if (m->actionArg != 1) {
enable_time_stop_if_alone(); enable_time_stop_if_alone();
} }
break; break;
case 12: case 12:
cutscene_take_cap_off(m); cutscene_take_cap_off(m);
if (gCamera->cutscene == CUTSCENE_PALETTE_EDITOR) { gCamera->paletteEditorCap = true; } if (m->actionArg == 1) { gCamera->paletteEditorCap = true; }
break; break;
default: default:
if (animFrame >= 30) { if (animFrame >= 30 || gCamera->cutscene != CUTSCENE_PALETTE_EDITOR) {
set_mario_action(m, ACT_IDLE, 0); set_mario_action(m, ACT_IDLE, 0);
disable_time_stop(); disable_time_stop();
} }