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 <gheskett@gmail.com>

---------

Co-authored-by: dnvic <business@dnvic.com>
Co-authored-by: Gregory Heskett <gheskett@gmail.com>
This commit is contained in:
DNVIC
2024-01-21 14:11:32 -05:00
committed by GitHub
parent 1d7a690361
commit bf924a8ec3
2 changed files with 20 additions and 0 deletions

View File

@@ -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.
*/

View File

@@ -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);