Skip to content

Commit e9f1cd5

Browse files
committed
fix(integration): correctly apply CPR "Ki Points" info
1 parent 67c2b2a commit e9f1cd5

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

module/js/integrations/ChrisPremades.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ export class IntegrationChrisPremades extends StartupHookMixin(IntegrationBase)
195195
const type = this._pGetExpandedAddonData_getItemType({propJson});
196196

197197
// Create a stubbed `Item` subclass to bypass CPR's `instanceof Item` check
198-
const fauxObject = this._pGetExpandedAddonData_getFauxObject({ent, propBase, base, fauxActor, type});
198+
const fauxName = this._pGetExpandedAddonData_getMappedName({propJson, name: ent.name});
199+
const fauxObject = this._pGetExpandedAddonData_getFauxObject({name: fauxName, propBase, base, fauxActor, type});
199200
if (!fauxObject) return null;
200201

201202
const jsonEmpty = fauxObject.toObject(true);
@@ -223,10 +224,20 @@ export class IntegrationChrisPremades extends StartupHookMixin(IntegrationBase)
223224
return "feat";
224225
}
225226

226-
_pGetExpandedAddonData_getFauxObject ({ent, propBase, base = undefined, fauxActor, type}) {
227+
static _MAPPED_NAMES = {
228+
"classFeature": {
229+
"Ki": "Ki Points",
230+
},
231+
};
232+
233+
_pGetExpandedAddonData_getMappedName ({propJson, name}) {
234+
return this.constructor._MAPPED_NAMES[propJson]?.[name] || name;
235+
}
236+
237+
_pGetExpandedAddonData_getFauxObject ({name, propBase, base = undefined, fauxActor, type}) {
227238
try {
228239
const docData = {
229-
name: ent.name,
240+
name,
230241
type,
231242
};
232243

0 commit comments

Comments
 (0)