botbowl icon indicating copy to clipboard operation
botbowl copied to clipboard

Unit with status heated can be found on the pitch

Open Drefsante opened this issue 2 years ago • 2 comments

It can happen that a player with 'heated' status is found on the pitch. See:

image

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.

Drefsante avatar Jun 15 '22 20:06 Drefsante

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

mrbermell avatar Jun 16 '22 11:06 mrbermell

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)

Drefsante avatar Jun 16 '22 18:06 Drefsante