fix: move action setter outside null guard
This commit is contained in:
parent
0cb0ca17ff
commit
7905ace2ca
1 changed files with 1 additions and 1 deletions
|
|
@ -448,8 +448,8 @@ static int handle_movement_input(GameState *gs) {
|
||||||
if (result == MOVE_RESULT_MOVED) {
|
if (result == MOVE_RESULT_MOVED) {
|
||||||
if (target != NULL) {
|
if (target != NULL) {
|
||||||
player_on_move(&gs->player);
|
player_on_move(&gs->player);
|
||||||
action = 1;
|
|
||||||
}
|
}
|
||||||
|
action = 1;
|
||||||
} else if (result == MOVE_RESULT_BLOCKED_ENEMY) {
|
} else if (result == MOVE_RESULT_BLOCKED_ENEMY) {
|
||||||
target = player_find_enemy_at(gs->enemies, gs->enemy_count, new_x, new_y);
|
target = player_find_enemy_at(gs->enemies, gs->enemy_count, new_x, new_y);
|
||||||
player_attack(&gs->player, target);
|
player_attack(&gs->player, target);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue