Skip to content

Commit

Permalink
fix h/a
Browse files Browse the repository at this point in the history
  • Loading branch information
inker committed Jul 7, 2024
1 parent b53e119 commit 5fa723a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/engine/dfs/ls/generateSchedule/getFirstSuitableMatchday.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ export default ({
) {
return true;
}
} else if (c.pickedMatchday >= numMatchdays - 2) {
// is last two
if (
c.locationByMatchday[
`${t}:${numMatchdays * 2 - 3 - c.pickedMatchday}`
] === loc
) {
return true;
}
} else {
} else if (
c.pickedMatchday >= numMatchdays - 2 && // is last two
c.locationByMatchday[
`${t}:${numMatchdays * 2 - 3 - c.pickedMatchday}`
] === loc
) {
return true;
}

if (c.pickedMatchday > 0 && c.pickedMatchday < numMatchdays - 1) {
const minus1 =
c.locationByMatchday[`${t}:${c.pickedMatchday - 1}`];
const plus1 =
Expand All @@ -134,10 +134,10 @@ export default ({
if (minus2 === loc) {
return true;
}
} else {
} else if (plus1 === loc) {
const plus2 =
c.locationByMatchday[`${t}:${c.pickedMatchday + 2}`];
if (plus1 === loc && plus2 === loc) {
if (plus2 === loc) {
return true;
}
}
Expand Down

0 comments on commit 5fa723a

Please sign in to comment.