Skip to content

Commit 33ee4a1

Browse files
committed
fix: update handle_move function
1 parent 624eb0a commit 33ee4a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/socha/api/networking/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def handle_move(move_response: _socha.Move) -> Data:
8585
return Data(class_value='eatsalad')
8686
elif isinstance(move_response.action, _socha.ExchangeCarrots):
8787
exchangeCarrots: _socha.ExchangeCarrots = move_response.action
88-
return Data(class_value='exchangecarrots', value=exchangeCarrots.amount)
88+
return Data(class_value='exchangecarrots', amount=exchangeCarrots.amount)
8989
elif isinstance(move_response.action, _socha.FallBack):
9090
return Data(class_value='fallback')
9191
else:
@@ -113,7 +113,7 @@ def create_hare(hare: Hare) -> _socha.Hare:
113113
carrots=hare.carrots,
114114
position=hare.position,
115115
last_move=_socha.Move(action=hare.last_action.class_binding)
116-
if hare.last_action
116+
if hare.last_action and hare.last_action.class_binding
117117
else None,
118118
salads=hare.salads,
119119
team=_socha.TeamEnum.One if hare.team == 'ONE' else _socha.TeamEnum.Two,

0 commit comments

Comments
 (0)