aboutsummaryrefslogtreecommitdiff
path: root/enemy.c
diff options
context:
space:
mode:
Diffstat (limited to 'enemy.c')
-rw-r--r--enemy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/enemy.c b/enemy.c
index 1c82e47..bc97030 100644
--- a/enemy.c
+++ b/enemy.c
@@ -121,9 +121,9 @@ void update_demon_move(Enemy* e, const World* w) {
int dist = fxsqrt(dx * dx2 + dy * dy2) >> fbits;
if (e->grounded < 3) {
int tx, ty =
- ((e->y >> fbits) - (map_tile_size >> 1)) /
+ ((e->y >> fbits) + (map_tile_size >> 1)) /
map_tile_size;
- int ty2 = ty + 2;
+ int ty2 = ty + 1;
if (e->face == face_left) {
tx = (
(e->x >> fbits) - (map_tile_size >> 1)) /
@@ -136,7 +136,7 @@ void update_demon_move(Enemy* e, const World* w) {
}
if (
tile_at(&w->map, tx, ty) ||
- (ty2 < map_h && !tile_at(&w->map, tx, ty2))
+ (!e->on_ramp && ty2 < map_h && !tile_at(&w->map, tx, ty2))
)
e->face = !e->face;
if (e->face == face_left) {