From 7cc986f55eec3bf595da9845dc516612c696ec28 Mon Sep 17 00:00:00 2001 From: Reonu Date: Wed, 30 Jun 2021 22:26:21 +0100 Subject: [PATCH] Revert "added hanging fix" This reverts commit 041bc62f0cd249b6ce0687a8c568dcc3b238c614. --- include/config.h | 2 -- src/game/mario_step.c | 17 +++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/config.h b/include/config.h index 9cb3722eb..5f392c2a2 100644 --- a/include/config.h +++ b/include/config.h @@ -70,8 +70,6 @@ #define NO_FALSE_LEDGEGRABS // Allows Mario to jump kick on steep surfaces that are set to be non slippery, instead of being forced to dive #define JUMP_KICK_FIX -// Allow Mario to grab hangable ceilings from any state -#define HANGING_FIX // 46 degree walkicks //#define WALLKICKS_46_DEGREES // Disables fall damage diff --git a/src/game/mario_step.c b/src/game/mario_step.c index bc2b643cd..7638e59fa 100644 --- a/src/game/mario_step.c +++ b/src/game/mario_step.c @@ -9,6 +9,8 @@ #include "interaction.h" #include "mario_step.h" +#include "config.h" + static s16 sMovingSandSpeeds[] = { 12, 8, 4, 0 }; struct Surface gWaterSurfacePseudoFloor = { @@ -268,7 +270,7 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) { upperWall = resolve_and_return_wall_collisions(nextPos, 60.0f, 50.0f); floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor); - ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil); + ceilHeight = vec3f_find_ceil(nextPos, nextPos[1], &ceil); waterLevel = find_water_level(nextPos[0], nextPos[2]); @@ -402,11 +404,11 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr lowerWall = resolve_and_return_wall_collisions(nextPos, 30.0f, 50.0f); floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor); - ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil); + ceilHeight = vec3f_find_ceil(nextPos, nextPos[1], &ceil); waterLevel = find_water_level(nextPos[0], nextPos[2]); - m->wall = NULL; + //m->wall = NULL; //! The water pseudo floor is not referenced when your intended qstep is // out of bounds, so it won't detect you as landing. @@ -448,12 +450,8 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr m->vel[1] = 0.0f; //! Uses referenced ceiling instead of ceil (ceiling hang upwarp) - #ifdef HANGING_FIX - if (m->ceil != NULL && m->ceil->type == SURFACE_HANGABLE) { - #else if ((stepArg & AIR_STEP_CHECK_HANG) && m->ceil != NULL && m->ceil->type == SURFACE_HANGABLE) { - #endif return AIR_STEP_GRABBED_CEILING; } @@ -494,8 +492,11 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr if (m->wall->type == SURFACE_BURNING) { return AIR_STEP_HIT_LAVA_WALL; } - + #ifdef WALLKICKS_46_DEGREES + if (wallDYaw < -0x5F00 || wallDYaw > 0x5700) { + #else if (wallDYaw < -0x6000 || wallDYaw > 0x6000) { + #endif m->flags |= MARIO_UNKNOWN_30; return AIR_STEP_HIT_WALL; }