Skip to content

Commit

Permalink
#109 & #110 validations
Browse files Browse the repository at this point in the history
  • Loading branch information
AloisSeckar committed Jul 7, 2023
1 parent af13227 commit 325e71d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions utils/wbsc-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ function checkUserInput (inputs: WBSCInput[]) {
validation = attachValidation(validation, checkPosSelection(posSelection))
}
}
if (input.specAction.includes('EN') || input.specAction.includes('CSN')) {
if (input.base - input.origBase > 1) {
validation = attachValidation(validation, '\'No advance\' action may not result into further advance')
}
} else if (input.specAction === 'SB') {
if (input.base - input.origBase > 1) {
validation = attachValidation(validation, '\'Stolen base\' may not result into further advance')
}
}
} else {
validation = attachValidation(validation, 'Action must be properly defined')
}
Expand Down

0 comments on commit 325e71d

Please # to comment.