From bf924a8ec32422cb83eeb3f4678bdf559e085b1b Mon Sep 17 00:00:00 2001 From: DNVIC <37513362+DNVIC@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:11:32 -0500 Subject: [PATCH] Added a define for slope fix (#749) * implemented a form of slope fix * fixed the slope fix to not allow for hyper cheese * implemented gheskett's suggestions * Added space between comment and define Co-authored-by: Gregory Heskett --------- Co-authored-by: dnvic Co-authored-by: Gregory Heskett --- include/config/config_movement.h | 5 +++++ src/game/mario_actions_moving.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/config/config_movement.h b/include/config/config_movement.h index 882ae3b9..7034d1d8 100644 --- a/include/config/config_movement.h +++ b/include/config/config_movement.h @@ -113,6 +113,11 @@ */ #define DONT_LEDGE_GRAB_STEEP_SLOPES +/** + * Buffers an A input if you jump off a slope during the landing lag + */ +// #define SLOPE_BUFFER + /** * Disables BLJs and crushes SimpleFlips's dreams. */ diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c index 2c72df9d..0f9c11e0 100644 --- a/src/game/mario_actions_moving.c +++ b/src/game/mario_actions_moving.c @@ -1402,6 +1402,20 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32 s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jumpAction, u32 airAction, s32 animation) { +#ifdef SLOPE_BUFFER + if (m->input & INPUT_A_PRESSED) { + m->actionState = 1; + } else if (!(m->input & INPUT_A_DOWN)) { + m->actionState = 0; + } + if (m->actionTimer == 5) { + if (m->actionState == 1) { + return set_jumping_action(m, jumpAction, 0); + } + } else { + m->actionTimer++; + } +#else if (m->actionTimer == 5) { if (m->input & INPUT_A_PRESSED) { return set_jumping_action(m, jumpAction, 0); @@ -1409,6 +1423,7 @@ s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jump } else { m->actionTimer++; } +#endif if (update_sliding(m, 4.0f)) { return set_mario_action(m, stopAction, 0);