Skip to content

Commit

Permalink
Merge pull request #298 from dstarosta/master
Browse files Browse the repository at this point in the history
Keep disappearing guard logic for super high jump consistent
  • Loading branch information
NagyD committed Feb 4, 2023
2 parents 834ebf3 + 9414934 commit 7aeacd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions src/seg002.c
Expand Up @@ -271,15 +271,6 @@ void check_guard_fallout() {

// seg002:02F5
void leave_guard() {

#ifdef USE_SUPER_HIGH_JUMP
// Do not leave guard during super high jumps when the room does not change.
// Kid's "y" coordinate keeps him in the lower room visually (in timers()).
if (fixes->enable_super_high_jump && super_jump_fall && drawn_room == next_room) {
return;
}
#endif

if (Guard.direction == dir_56_none || Guard.charid == charid_1_shadow || Guard.charid == charid_24_mouse) {
return;
}
Expand Down Expand Up @@ -337,6 +328,13 @@ void exit_room() {
next_room = Char.room;
#ifdef FIX_DISAPPEARING_GUARD_B
if (next_room == drawn_room) return;
#endif
#ifdef USE_SUPER_HIGH_JUMP
// Do not change the room during super high jumps from row 1.
// Kid's "y" coordinate keeps him in the room below (in timers()).
if (fixes->enable_super_high_jump && super_jump_fall && next_room == drawn_room) {
return;
}
#endif
if (Guard.direction == dir_56_none) return;
if (Guard.alive < 0 && Guard.sword == sword_2_drawn) {
Expand Down
2 changes: 1 addition & 1 deletion src/seg006.c
Expand Up @@ -1178,7 +1178,7 @@ void check_grab() {
old_x = Char.x;
#ifdef USE_SUPER_HIGH_JUMP
// delta_x makes grabbing easier
#define SUPER_HIGH_JUMP_DELTA_X (Char.direction == dir_FF_left ? 3 : 5)
#define SUPER_HIGH_JUMP_DELTA_X (Char.direction == dir_FF_left ? 3 : 4)
Char.x = char_dx_forward(-8 + (fixes->enable_super_high_jump && super_jump_fall ? SUPER_HIGH_JUMP_DELTA_X : 0));
#else
Char.x = char_dx_forward(-8);
Expand Down

0 comments on commit 7aeacd8

Please sign in to comment.