From 4044543fe1d4b2d717a933d42e7955a27609b431 Mon Sep 17 00:00:00 2001 From: Squirrel Modeller Date: Thu, 9 Apr 2026 15:28:57 +0200 Subject: [PATCH] fix: move guard check I am stupid. I added the guard on the wrong check. Ffs... --- src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 1218b2f..d90487b 100644 --- a/src/main.c +++ b/src/main.c @@ -446,14 +446,14 @@ static int handle_movement_input(GameState *gs) { MoveResult result = try_move_entity(&gs->player.position, direction, &gs->map, &gs->player, gs->enemies, gs->enemy_count, true); if (result == MOVE_RESULT_MOVED) { - if (target != NULL) { - player_on_move(&gs->player); - } + player_on_move(&gs->player); action = 1; } else if (result == MOVE_RESULT_BLOCKED_ENEMY) { target = player_find_enemy_at(gs->enemies, gs->enemy_count, new_x, new_y); - player_attack(&gs->player, target); - action = 1; + if (target != NULL) { + player_attack(&gs->player, target); + action = 1; + } } if (action)