Skip to content

Commit

Permalink
Fix issue with rounds not showing correct time remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
DFreds committed Mar 5, 2024
1 parent d1e537a commit 46e69ea
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/app/effects-panel-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,11 @@ export default class EffectsPanelController {
return canvas.tokens.controlled[0]?.actor ?? game.user?.character ?? null;
}

// TODO consider handling rounds/seconds/turns based on whatever is defined for the effect rather than do conversions
_getSecondsRemaining(duration) {
if (duration.seconds || duration.rounds) {
const seconds =
duration.seconds ?? duration.rounds * (CONFIG.time?.roundTime ?? 6);
return duration.startTime + seconds - game.time.worldTime;
if (duration.seconds) {
return duration.startTime + duration.seconds - game.time.worldTime;
} else if (duration.rounds) {
return (duration.rounds - duration.startRound) * CONFIG.time.roundTime;
} else {
return Infinity;
}
Expand Down

0 comments on commit 46e69ea

Please sign in to comment.