Skip to content

Commit

Permalink
Merge pull request #55 from ctbritt/patch-1
Browse files Browse the repository at this point in the history
Update group-initiative.js
  • Loading branch information
vtt-lair authored May 23, 2024
2 parents a0eae01 + 99e33ce commit 28df2ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions group-initiative.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const GroupInitiative = {
groups = creatures.reduce(
(g, combatant) => ({
...g,
[combatant.actor.id]: (g[combatant.actor.id] || []).concat(combatant.data._id),
[combatant.actor.id]: (g[combatant.actor.id] || []).concat(combatant._id),
}),
{}
);
Expand All @@ -113,7 +113,7 @@ const GroupInitiative = {
if (game.version.split('.')[0] === '10') {
group = groups[actor.id];
} else {
group = groups[actor.data._id];
group = groups[actor._id];
}

if (group.length <= 1 || initiative) return updates;
Expand All @@ -135,7 +135,7 @@ const GroupInitiative = {
* @returns {Boolean} shouldReplace
*/
shouldReplaceName(actor) {
const dispositionEnum = actor.isToken ? actor.token.data.disposition : actor.data.token.disposition;
const dispositionEnum = actor.isToken ? actor.token.disposition : actor.token.disposition;
const disposition = Object.keys(CONST.TOKEN_DISPOSITIONS).find(key => CONST.TOKEN_DISPOSITIONS[key] === dispositionEnum);
const dispositionEnableSetting = game.settings.get('combat-utility-belt', _gi_settingkeys.hideNames[`enable${disposition.titleCase()}`]);
const actorEnableFlag = actor.getFlag('combat-utility-belt', 'enableHideName');
Expand All @@ -150,7 +150,7 @@ const GroupInitiative = {
* @returns {String} replacementName
*/
getReplacementName(actor) {
const dispositionEnum = actor.isToken ? actor.token.data.disposition : actor.data.token.disposition;
const dispositionEnum = actor.isToken ? actor.token.disposition : actor.token.disposition;
const disposition = Object.keys(CONST.TOKEN_DISPOSITIONS).find(key => CONST.TOKEN_DISPOSITIONS[key] === dispositionEnum);
const replacementSetting = game.settings.get('combat-utility-belt', _gi_settingkeys.hideNames[`${disposition.toLowerCase()}NameReplacement`]);
const replacementFlag = actor.getFlag('combat-utility-belt', 'hideNameReplacement');
Expand Down

0 comments on commit 28df2ea

Please sign in to comment.