Fix the stationary action and ledgegrab downwarps when pushed off a ledge, and added a special downwarp for grabbing Bowser (#664)

* fix stationary/ledge downwarp, special bowser case

* Comment clarity

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>

---------

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
This commit is contained in:
CowQuack
2023-08-30 21:53:04 -04:00
committed by GitHub
parent d13f0cb2fc
commit 90a9e978cc
2 changed files with 10 additions and 5 deletions

View File

@@ -418,6 +418,8 @@ u32 mario_check_object_grab(struct MarioState *m) {
if (facingDYaw >= -0x5555 && facingDYaw <= 0x5555) { if (facingDYaw >= -0x5555 && facingDYaw <= 0x5555) {
m->faceAngle[1] = m->interactObj->oMoveAngleYaw; m->faceAngle[1] = m->interactObj->oMoveAngleYaw;
m->usedObj = m->interactObj; m->usedObj = m->interactObj;
m->pos[1] = m->floorHeight;
m->vel[1] = 0.0f;
result = set_mario_action(m, ACT_PICKING_UP_BOWSER, 0); result = set_mario_action(m, ACT_PICKING_UP_BOWSER, 0);
} }
} else { } else {

View File

@@ -242,8 +242,10 @@ void stop_and_set_height_to_floor(struct MarioState *m) {
mario_set_forward_vel(m, 0.0f); mario_set_forward_vel(m, 0.0f);
m->vel[1] = 0.0f; m->vel[1] = 0.0f;
//! This is responsible for some downwarps. // HackerSM64 2.1: This check fixes the ledgegrab downwarp after being pushed off a ledge.
m->pos[1] = m->floorHeight; if (m->pos[1] <= m->floorHeight + 160.0f) {
m->pos[1] = m->floorHeight;
}
vec3f_copy(marioObj->header.gfx.pos, m->pos); vec3f_copy(marioObj->header.gfx.pos, m->pos);
vec3s_set(marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); vec3s_set(marioObj->header.gfx.angle, 0, m->faceAngle[1], 0);
@@ -259,9 +261,10 @@ s32 stationary_ground_step(struct MarioState *m) {
if (takeStep) { if (takeStep) {
stepResult = perform_ground_step(m); stepResult = perform_ground_step(m);
} else { } else {
//! TODO - This is responsible for many stationary downwarps but is // HackerSM64 2.1: This check prevents the downwarps that plagued stationary actions.
// important for stuff like catching Bowser in midair, figure out a good way to fix if (m->pos[1] <= m->floorHeight + 160.0f) {
m->pos[1] = m->floorHeight; m->pos[1] = m->floorHeight;
}
vec3f_copy(marioObj->header.gfx.pos, m->pos); vec3f_copy(marioObj->header.gfx.pos, m->pos);
vec3s_set(marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); vec3s_set(marioObj->header.gfx.angle, 0, m->faceAngle[1], 0);