Correction imports du compendium

- les personnages conservent la valeur de token lié/non-lié
- les voyageirs sont liés
- les PNJs sont non-liés
- les invocations sont non liées
This commit is contained in:
2024-12-09 22:24:22 +01:00
parent 60921cfef1
commit b160ce78bc
14 changed files with 30 additions and 17 deletions

View File

@ -176,11 +176,19 @@ export class RdDBaseActor extends Actor {
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 });
if (this.type === "personnage") {
this.updateSource({
sight: { enabled: true },
actorLink: options.fromCompendium ? data.prototypeToken.actorLink : true,
disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
})
} else {
const prototypeToken = {
sight: { enabled: true },
disposition: CONST.TOKEN_DISPOSITIONS.NEUTRAL
}
this.updateSource({ prototypeToken });
}
}
/* -------------------------------------------- */