Skip to content

Commit f4c6961

Browse files
committed
Prevent Locking Mario's HP in the Pause Menu
This needed to be changed to not trigger other codes while being used. Also changed the button combination for this code.
1 parent a9a9a06 commit f4c6961

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ttyd-tools/rel/source/codes/MarioLockHPToggleC.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "mod.h"
22

33
#include <ttyd/system.h>
4+
#include <ttyd/mariost.h>
45
#include <ttyd/mario_pouch.h>
56

67
#include <cstdio>
@@ -13,12 +14,14 @@ namespace mod {
1314
void Mod::lockMarioHPToggle()
1415
{
1516
uint32_t ButtonInput = ttyd::system::keyGetButton(0);
17+
uint32_t SystemLevel = ttyd::mariost::marioStGetSystemLevel();
1618

1719
if (!MarioHPCurrentlyLocked)
1820
{
1921
// HP not currently locked
20-
if ((ButtonInput & LockMarioHPToggleCombo) == LockMarioHPToggleCombo)
22+
if (((ButtonInput & LockMarioHPToggleCombo) == LockMarioHPToggleCombo) && (SystemLevel != 15))
2123
{
24+
// Not in pause menu
2225
if (!lockMarioHPToggleDisable)
2326
{
2427
MarioHPCurrentlyLocked = true;
@@ -48,8 +51,9 @@ void Mod::lockMarioHPToggle()
4851
}
4952
}
5053

51-
if ((ButtonInput & LockMarioHPToggleCombo) == LockMarioHPToggleCombo)
54+
if (((ButtonInput & LockMarioHPToggleCombo) == LockMarioHPToggleCombo) && (SystemLevel != 15))
5255
{
56+
// Not in pause menu
5357
if (!lockMarioHPToggleDisable)
5458
{
5559
MarioHPCurrentlyLocked = false;

ttyd-tools/rel/source/global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ uint16_t RemovePartnersCombo = PAD_R | PAD_Y;
9595
uint16_t ResetGSWFFlagsCombo = PAD_R | PAD_B | PAD_X;
9696

9797
// Lock Mario's HP; Toggle
98-
uint16_t LockMarioHPToggleCombo = PAD_R | PAD_DPAD_DOWN;
98+
uint16_t LockMarioHPToggleCombo = PAD_R | PAD_Y | PAD_X;
9999

100100
// Save Anywhere
101101
uint16_t SaveAnywhereCombo = PAD_Y | PAD_B;

0 commit comments

Comments
 (0)