assignable tunics/boots - dont throw items (#5045)
* don't throw items when using assigned tunics/boots * didn't actually need that * simplify logic so we don't need to check for holding items * just use a vb should * fix comment
This commit is contained in:
@@ -87,6 +87,28 @@ void RegisterAssignableTunicsBoots() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// don't throw items when the pressed button is a tunic or boots
|
||||||
|
COND_VB_SHOULD(VB_THROW_OR_PUT_DOWN_HELD_ITEM, CVAR_TUNICBOOTS_VALUE != CVAR_TUNICBOOTS_DEFAULT, {
|
||||||
|
// if the vanilla condition doesn't want us to throw/put down the item, early return
|
||||||
|
if (!*should) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Input* input = va_arg(args, Input*);
|
||||||
|
|
||||||
|
s32 item = ITEM_NONE;
|
||||||
|
for (s32 i = 0; i < ARRAY_COUNT(sItemButtons); i++) {
|
||||||
|
if (CHECK_BTN_ALL(input->press.button, sItemButtons[i])) {
|
||||||
|
item = Player_GetItemOnButton(gPlayState, i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item >= ITEM_TUNIC_KOKIRI && item <= ITEM_BOOTS_HOVER) {
|
||||||
|
*should = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// do something when the player presses a button to use the tunics/boots
|
// do something when the player presses a button to use the tunics/boots
|
||||||
COND_VB_SHOULD(VB_EXECUTE_PLAYER_ACTION_FUNC, CVAR_TUNICBOOTS_VALUE != CVAR_TUNICBOOTS_DEFAULT, {
|
COND_VB_SHOULD(VB_EXECUTE_PLAYER_ACTION_FUNC, CVAR_TUNICBOOTS_VALUE != CVAR_TUNICBOOTS_DEFAULT, {
|
||||||
// if the vanilla condition doesn't want us to run the actionFunc, don't do any of this
|
// if the vanilla condition doesn't want us to run the actionFunc, don't do any of this
|
||||||
|
|||||||
@@ -1794,6 +1794,15 @@ typedef enum {
|
|||||||
// - `*ShotSun`
|
// - `*ShotSun`
|
||||||
VB_SPAWN_SONG_FAIRY,
|
VB_SPAWN_SONG_FAIRY,
|
||||||
|
|
||||||
|
// #### `result`
|
||||||
|
// ```c
|
||||||
|
// (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) &&
|
||||||
|
// CHECK_BTN_ANY(sControlInput->press.button, buttonsToCheck)
|
||||||
|
// ```
|
||||||
|
// #### `args`
|
||||||
|
// - `*Input`
|
||||||
|
VB_THROW_OR_PUT_DOWN_HELD_ITEM,
|
||||||
|
|
||||||
// #### `result`
|
// #### `result`
|
||||||
// ```c
|
// ```c
|
||||||
// true
|
// true
|
||||||
|
|||||||
@@ -7436,8 +7436,10 @@ s32 Player_ActionHandler_9(Player* this, PlayState* play) {
|
|||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||||
}
|
}
|
||||||
if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) &&
|
if (GameInteractor_Should(VB_THROW_OR_PUT_DOWN_HELD_ITEM, (
|
||||||
CHECK_BTN_ANY(sControlInput->press.button, buttonsToCheck)) {
|
(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) &&
|
||||||
|
CHECK_BTN_ANY(sControlInput->press.button, buttonsToCheck)
|
||||||
|
), sControlInput)) {
|
||||||
if (!func_80835644(play, this, this->heldActor)) {
|
if (!func_80835644(play, this, this->heldActor)) {
|
||||||
if (!func_8083EAF0(this, this->heldActor)) {
|
if (!func_8083EAF0(this, this->heldActor)) {
|
||||||
Player_SetupAction(play, this, Player_Action_808464B0, 1);
|
Player_SetupAction(play, this, Player_Action_808464B0, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user