Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit with status heated can be found on the pitch #240

Open
Drefsante opened this issue Jun 15, 2022 · 2 comments
Open

Unit with status heated can be found on the pitch #240

Drefsante opened this issue Jun 15, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Drefsante
Copy link

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.

@mrbermell
Copy link
Collaborator

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

@Drefsante
Copy link
Author

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)

@njustesen njustesen added the bug Something isn't working label Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants