From 0d47a0f401c6adfa5f414a020037d8d6223e270b Mon Sep 17 00:00:00 2001 From: Alula <6276139+alula@users.noreply.github.com> Date: Mon, 21 Jun 2021 13:35:19 +0200 Subject: [PATCH] more collision fixes --- src/player/player_hit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/player/player_hit.rs b/src/player/player_hit.rs index 2929972..911b6dd 100644 --- a/src/player/player_hit.rs +++ b/src/player/player_hit.rs @@ -101,7 +101,7 @@ impl Player { let mut flags = Flag(0); if ((self.y - self.hit_bounds.top as i32) < (npc.y + npc.hit_bounds.bottom as i32 - 0x600)) - && ((self.y + self.hit_bounds.top as i32) > (npc.y - npc.hit_bounds.bottom as i32 + 0x600)) + && ((self.y + self.hit_bounds.bottom as i32) > (npc.y - npc.hit_bounds.bottom as i32 + 0x600)) && ((self.x - self.hit_bounds.right as i32) < (npc.x + npc.hit_bounds.right as i32)) && ((self.x - self.hit_bounds.right as i32) > npc.x) { if self.vel_x < 0x200 { @@ -112,7 +112,7 @@ impl Player { } if ((self.y - self.hit_bounds.top as i32) < (npc.y + npc.hit_bounds.bottom as i32 - 0x600)) - && ((self.y + self.hit_bounds.top as i32) > (npc.y - npc.hit_bounds.bottom as i32 + 0x600)) + && ((self.y + self.hit_bounds.bottom as i32) > (npc.y - npc.hit_bounds.bottom as i32 + 0x600)) && ((self.x + self.hit_bounds.right as i32 - 0x200) > (npc.x - npc.hit_bounds.right as i32)) && ((self.x + self.hit_bounds.right as i32 - 0x200) < npc.x) { if self.vel_x > -0x200 {