Skip to content

Commit ae46d35

Browse files
committed
feat: do not do anything if bot is dead
1 parent 4eeaf95 commit ae46d35

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/bot_manager/lib/bot_state_machine.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ defmodule BotManager.BotStateMachine do
2222
%{action: {:move, %{x: 0, y: 0}}, bot_state_machine: bot_state_machine}
2323
end
2424

25+
def decide_action(%{bot_player: %{aditional_info: {:player, %{health: health}}}, bot_state_machine: bot_state_machine}) when health <= 0 do
26+
%{action: {:move, %{x: 0, y: 0}}, bot_state_machine: bot_state_machine}
27+
end
28+
2529
@doc """
2630
This function will decide the next action for the bot.
2731
"""

0 commit comments

Comments
 (0)