fix combo input checking

This commit is contained in:
TakaRikka
2026-09-01 14:50:23 -07:00
parent 0fd17fe082
commit d60cc9095f
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ static daAlink_c* getPlayer() {
return (daAlink_c*)dComIfGp_getPlayer(0);
}
static void consumeButtons(u32 mask) {
static void consumeButtons(u16 mask) {
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags &= ~mask;
mDoCPd_c::getCpadInfo(PAD_1).mButtonFlags &= ~mask;
}
@@ -107,8 +107,8 @@ void processGameCombos() {
getTransientSettings().moveLinkActive = false;
}
const u32 held = mDoCPd_c::getHold(PAD_1);
const u32 trig = mDoCPd_c::getTrig(PAD_1);
const u16 held = mDoCPd_c::getHold(PAD_1) & 0xFFFF;
const u16 trig = mDoCPd_c::getTrig(PAD_1) & 0xFFFF;
for (const auto& combo : kCombos) {
if ((held & combo.holdMask) != combo.holdMask) {
+3 -3
View File
@@ -8,12 +8,12 @@ struct GameCombo {
using ConditionFn = bool(*)();
using ActionFn = void(*)();
u32 holdMask; // all of these must be held (getHold)
u32 trigMask; // at least one must be newly triggered (getTrig); 0 = fires every frame while holdMask is held
u16 holdMask; // all of these must be held (getHold)
u16 trigMask; // at least one must be newly triggered (getTrig); 0 = fires every frame while holdMask is held
bool strict; // if true: (held & ~trigMask) must equal holdMask exactly, no extra buttons held
ConditionFn condition; // extra game-state guard; nullptr = no extra check
ActionFn action; // runs when the combo is fired
u32 consumeMask; // buttons to clear after firing; 0 = pass-through
u16 consumeMask; // buttons to clear after firing; 0 = pass-through
bool exclusive; // stop evaluating future combos if this fires
};