added hanging fix

This commit is contained in:
Reonu
2021-06-30 22:24:18 +01:00
parent 287b6d2d02
commit 041bc62f0c
2 changed files with 10 additions and 9 deletions

View File

@@ -70,6 +70,8 @@
#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

View File

@@ -9,8 +9,6 @@
#include "interaction.h"
#include "mario_step.h"
#include "config.h"
static s16 sMovingSandSpeeds[] = { 12, 8, 4, 0 };
struct Surface gWaterSurfacePseudoFloor = {
@@ -270,7 +268,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, nextPos[1], &ceil);
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
waterLevel = find_water_level(nextPos[0], nextPos[2]);
@@ -404,11 +402,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, nextPos[1], &ceil);
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &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.
@@ -450,8 +448,12 @@ 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;
}
@@ -492,11 +494,8 @@ 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;
}