From 407e74ccf7b7c63581cd3eddd06285b275800a8c Mon Sep 17 00:00:00 2001 From: Sunk <69110309+Sunketchupm@users.noreply.github.com> Date: Wed, 9 Apr 2025 19:13:18 -0400 Subject: [PATCH] Fix water pvp (#728) * Fix water pvp * Revert "Fix water pvp" This reverts commit 95adc3206e9738bf0272eaf0512d8c5879d574ff. * The real fix Turns out I needed to swap the x and z facing angles for the calculations --- src/game/interaction.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/interaction.c b/src/game/interaction.c index 3f8864e63..dcde33a1d 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -153,13 +153,13 @@ u32 determine_interaction(struct MarioState *m, struct Object *o) { // hack: make water punch actually do something if (interaction == 0 && m->action == ACT_WATER_PUNCH && o->oInteractType & INTERACT_PLAYER) { - f32 cossFaceAngle0 = coss(m->faceAngle[0]); - Vec3f facing = { coss(m->faceAngle[1])*cossFaceAngle0, sins(m->faceAngle[0]), sins(m->faceAngle[1])*cossFaceAngle0 }; - Vec3f dif = { o->oPosX - m->pos[0], (o->oPosY + o->hitboxHeight * 0.5) - m->pos[1], o->oPosZ - m->pos[2] }; + f32 cossPitch = coss(m->faceAngle[0]); + Vec3f facing = { sins(m->faceAngle[1])*cossPitch, sins(m->faceAngle[0]), coss(m->faceAngle[1])*cossPitch }; + Vec3f dif = { o->oPosX - m->pos[0], (o->oPosY + o->hitboxHeight * 0.5) - (m->pos[1] + m->marioObj->hitboxHeight * 0.5), o->oPosZ - m->pos[2] }; vec3f_normalize(dif); f32 angle = vec3f_dot(facing, dif); // Unknown angle (60 degrees in each direction?) - if (angle >= 0.5f) { + if (angle >= 0.6f) { interaction = INT_PUNCH; } }