diff options
author | quou <quou@disroot.org> | 2024-10-01 18:34:23 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-10-01 18:34:23 +1000 |
commit | 626a3850ebc4859cecb9b3a003c96b69c2fdf7f9 (patch) | |
tree | e5ca3bd026e3e9f6ba83453abb89466eb3017526 | |
parent | 20311c69d2fd4315e3fecf731819d7eba3152871 (diff) |
fix enemy patrol
-rw-r--r-- | enemy.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |