Properly fix lua interaction flags (#704)
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run

Reverts a change Isaac did a little while ago and fixes the source of the issue
This commit is contained in:
Sunk 2025-03-14 13:47:23 -04:00 committed by GitHub
parent edacdcc7e4
commit dc4ac0f681
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -166,7 +166,8 @@ u32 determine_interaction(struct MarioState *m, struct Object *o) {
if ((interaction == 0 || interaction & INT_LUA) && action & ACT_FLAG_ATTACKING) {
u32 flags = (MARIO_PUNCHING | MARIO_KICKING | MARIO_TRIPPING);
if (m->flags & flags) {
if ((action == ACT_PUNCHING || action == ACT_MOVE_PUNCHING || action == ACT_JUMP_KICK) ||
((m->flags & flags) && (interaction & INT_LUA))) {
s16 dYawToObject = mario_obj_angle_to_object(m, o) - m->faceAngle[1];
if (m->flags & MARIO_PUNCHING) {

View file

@ -1177,12 +1177,12 @@ int smlua_hook_mario_action(lua_State* L) {
lua_Integer interactionType = 0;
if (paramCount >= 3) {
interactionType = smlua_to_integer(L, 3);
interactionType |= (1 << 31); /* INT_LUA */
if (!gSmLuaConvertSuccess) {
LOG_LUA_LINE("Hook Action: tried to hook invalid interactionType: %lld, %u", interactionType, gSmLuaConvertSuccess);
return 0;
}
}
interactionType |= (1 << 31); /* INT_LUA */
struct LuaHookedMarioAction* hooked = &sHookedMarioActions[sHookedMarioActionsCount];