Skip to content

Commit

Permalink
[core] Fix Active Time double dipping on channels (WoWAnalyzer#6909)
Browse files Browse the repository at this point in the history
* Fix overcounting channels for active time

* changelog
  • Loading branch information
Krealle authored Jul 31, 2024
1 parent 9b1658f commit 661d70f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import SpellLink from 'interface/SpellLink';

// prettier-ignore
export default [
change(date(2024, 7, 31), 'Fixed an issue with AlwaysBeCasting over counting channels.', Vollmer),
change(date(2024, 7, 29), 'Fixed handling of not-found and private logs.', emallson),
change(date(2024, 7, 27), "Fixed an issue where fully supported specs on spec list weren't displaying their maintainer.", Sref),
change(date(2024, 7, 22), 'Fix partial support indication on spec list.', ToppleTheNun),
Expand Down
8 changes: 7 additions & 1 deletion src/parser/shared/modules/AlwaysBeCasting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AlwaysBeCasting extends Analyzer {
// Ignore prepull casts for active time since active time should only include casts during the
return false;
}
if (event.trigger.type === EventType.BeginChannel) {
if (event.trigger.type === EventType.BeginChannel || event.trigger.channel) {
// Only add active time for this channel, we do this when the channel is finished and use the highest of the GCD and channel time
return false;
}
Expand Down Expand Up @@ -122,6 +122,12 @@ class AlwaysBeCasting extends Analyzer {
if (this.globalCooldown.isOnGlobalCooldown(event.ability.guid)) {
amount = Math.max(amount, this._lastGlobalCooldownDuration);
}

// check if the initial channel is from pre-pull, if it is, only count active time from the beginning of the fight
if (!this.activeTimeSegments.length) {
amount = Math.min(amount, event.timestamp - this.owner.fight.start_time);
}

this.activeTime += amount;
this._handleNewUptimeSegment(event.timestamp - amount, event.timestamp);
DEBUG &&
Expand Down

0 comments on commit 661d70f

Please sign in to comment.