Skip to content

Commit

Permalink
typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonepatr committed Jan 21, 2022
1 parent 27ece90 commit 8921642
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/module/entities/TwodsixActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type TwodsixItem from "./TwodsixItem";
import { Stats } from "../utils/actorDamage";
import { Characteristic, Component, Gear, Skills, Traveller, Weapon } from "../../types/template";
import { simplifySkillName } from "../utils/utils";
import { DocumentModificationOptions } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/common/abstract/document.mjs";

export default class TwodsixActor extends Actor {
/**
Expand Down Expand Up @@ -135,8 +136,8 @@ export default class TwodsixActor extends Actor {
return 0;
}


_onUpdateEmbeddedDocuments(embeddedName:string, documents:foundry.abstract.Document<any, any>[], result:Record<string, unknown>[]): void {
protected override _onUpdateEmbeddedDocuments(embeddedName:string, documents:foundry.abstract.Document<any, any>[], result:Record<string, unknown>[], options: DocumentModificationOptions, userId: string): void {
super._onUpdateEmbeddedDocuments(embeddedName, documents, result, options, userId);
if (embeddedName === "ActiveEffect") {
documents.forEach(async (element:ActiveEffect, i) => {
const activeEffectId = element.getFlag("twodsix", "sourceId");
Expand Down
4 changes: 2 additions & 2 deletions src/module/entities/TwodsixItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { TwodsixDiceRoll } from "../utils/TwodsixDiceRoll";
import { TwodsixRollSettings } from "../utils/TwodsixRollSettings";
import TwodsixActor from "./TwodsixActor";
import { DICE_ROLL_MODES } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/common/constants.mjs";
import {Consumable, Gear, Skills, UsesConsumables, Weapon} from "../../types/template";
import { ItemDataConstructorData } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/common/data/data.mjs/itemData";


export default class TwodsixItem extends Item {
public static async create(data, options?): Promise<TwodsixItem> {
public static async create(data: ItemDataConstructorData, options?: DocumentModificationContext): Promise<TwodsixItem> {
const item = await super.create(data, options) as unknown as TwodsixItem;
item?.setFlag('twodsix', 'newItem', true);
if (item?.data.type === 'weapon' && (item.data.img === "" || item.data.img === foundry.data.ItemData.DEFAULT_ICON)) {
Expand Down

0 comments on commit 8921642

Please sign in to comment.