Sur creation de personnage, force le lien du token

This commit is contained in:
LeRatierBretonnien 2023-11-04 17:48:59 +01:00
parent e6592f8333
commit 728c5f2f8e

View File

@ -111,6 +111,19 @@ export class RdDBaseActor extends Actor {
super(docData, context); super(docData, context);
} }
/* -------------------------------------------- */
async _preCreate(data, options, user) {
await super._preCreate(data, options, user);
// Configure prototype token settings
const prototypeToken = {};
if (this.type === "personnage") Object.assign(prototypeToken, {
sight: { enabled: true }, actorLink: true, disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
});
this.updateSource({ prototypeToken });
}
/* -------------------------------------------- */
isCreatureEntite() { return this.type == 'creature' || this.type == 'entite'; } isCreatureEntite() { return this.type == 'creature' || this.type == 'entite'; }
isCreature() { return this.type == 'creature'; } isCreature() { return this.type == 'creature'; }
isEntite() { return this.type == 'entite'; } isEntite() { return this.type == 'entite'; }