diff --git a/js/planner.js b/js/planner.js index 273e078..5db6c43 100644 --- a/js/planner.js +++ b/js/planner.js @@ -836,7 +836,9 @@ function layoutBossActions(mechanics, duration) { } function assignmentWindowMs(assignment) { - return Math.max(1, assignmentDurationSeconds(assignment)) * 1000; + const durationMs = Math.max(1, assignmentDurationSeconds(assignment)) * 1000; + const cooldownMs = assignmentCooldownSeconds(assignment) * 1000; + return Math.max(durationMs, cooldownMs); } function sameAssignmentRef(mechanic, assignment, ref) { @@ -847,7 +849,9 @@ function sameAssignmentRef(mechanic, assignment, ref) { } function assignmentOverlapsJob(plan, job, ability, timestamp, ignore = null, candidate = null) { - const candidateWindow = Math.max(candidate ? assignmentDurationSeconds(candidate) : 0, 1) * 1000; + const candidateDurationMs = Math.max(candidate ? assignmentDurationSeconds(candidate) : 0, 1) * 1000; + const candidateCooldownMs = candidate ? assignmentCooldownSeconds(candidate) * 1000 : 0; + const candidateWindow = Math.max(candidateDurationMs, candidateCooldownMs); const candidateStart = Math.max(0, timestamp); const candidateEnd = candidateStart + candidateWindow; const ignoredActivation = assignmentEntryForRef(plan, ignore);