botbowl
botbowl copied to clipboard
Unit with status heated can be found on the pitch
It can happen that a player with 'heated' status is found on the pitch. See:
Maybe it's coming from:
class ClearBoard(Procedure): [...] if player.position is not None: # Set to ready player.state.reset()
Method reset() is called only for player on the board -> status remains to heated.
I expect this test to pass. It doesn't.
def test_sweltering_heat():
game = get_game_coin_toss()
for player_away, player_home in zip(game.state.home_team.players[:6], game.state.away_team.players[:6]):
player_away.state.heated = True
player_home.state.heated = True
game.step(Action(ActionType.START_GAME))
game.step(Action(ActionType.HEADS))
game.step(Action(ActionType.RECEIVE))
game.step(Action(ActionType.SETUP_FORMATION_SPREAD))
game.step(Action(ActionType.END_SETUP))
game.step(Action(ActionType.SETUP_FORMATION_LINE))
game.step(Action(ActionType.END_SETUP))
for player in game.get_players_on_pitch():
assert player.position is not None
assert not player.state.heated
Yes! You should check also:
- some players are 'heated'
- one team scores
- check status: none should be 'heated' (if result of weather table is not Sweltering Heat)