Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GallagherAiden committed Dec 19, 2020
2 parents 04fc2e3 + 73ef7fb commit 1276e03
Show file tree
Hide file tree
Showing 4 changed files with 1,447 additions and 1,665 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module.exports = {
rules: {
'no-console': 'off'
}
};
}
8 changes: 6 additions & 2 deletions lib/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ function resolveTackle(player, team, opposition, matchDetails) {
let index = opposition.players.findIndex(function(thisPlayer) {
return thisPlayer.playerID === matchDetails.ball.Player
})
let thatPlayer = opposition.players[index]
let thatPlayer
if (index) thatPlayer = opposition.players[index]
else return false
player.stats.tackles.total++
if (wasFoul(10, 18)) {
setFoul(matchDetails, team, player, thatPlayer)
Expand All @@ -357,7 +359,9 @@ function resolveSlide(player, team, opposition, matchDetails) {
let index = opposition.players.findIndex(function(thisPlayer) {
return thisPlayer.playerID === matchDetails.ball.Player
})
let thatPlayer = opposition.players[index]
let thatPlayer
if (index) thatPlayer = opposition.players[index]
else return false
player.stats.tackles.total++
if (wasFoul(11, 20)) {
setFoul(matchDetails, team, player, thatPlayer)
Expand Down
Loading

0 comments on commit 1276e03

Please sign in to comment.