Skip to content

IndexOutOfRangeException when attacking unreasonable target #101

@Vogel612

Description

@Vogel612

When writing the unit tests I stumbled upon the following:

String testString = "attack 200 1542";

If this is executed, following error appears in the console:

"the targetMonsterIndex must be in range: 1542, expected: [0, 5)"

Expected output would be: "Action not allowed". The code fails on creation of the AtackMonsterAction, where Arguments.requireInRange(targetMonsterIndex, 0, targetPlayer.getField().getMonsterCapacity(), "targetMonsterIndex"); throws the IndexOutOfRangeException

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions