mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fix water pvp (#728)
* Fix water pvp
* Revert "Fix water pvp"
This reverts commit 95adc3206e.
* The real fix
Turns out I needed to swap the x and z facing angles for the calculations
This commit is contained in:
parent
e1c0d87ea8
commit
407e74ccf7
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue