1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-11-30 16:18:00 +00:00

more collision fixes

This commit is contained in:
Alula 2021-06-21 13:35:19 +02:00
parent 215ec9ed6c
commit 0d47a0f401
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -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 {