mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Fix PC actorLink (#92)
This commit is contained in:
parent
d34272a301
commit
58e912d641
1 changed files with 9 additions and 6 deletions
|
|
@ -5,12 +5,15 @@ import { GMUpdateEvent, socketEvent } from '../helpers/socket.mjs';
|
|||
import { setDiceSoNiceForDualityRoll } from '../helpers/utils.mjs';
|
||||
|
||||
export default class DhpActor extends Actor {
|
||||
_preCreate(data, changes, user) {
|
||||
if (data.type === 'pc') {
|
||||
data.prototypeToken = { actorLink: true, disposition: 1, sight: { enabled: true } };
|
||||
}
|
||||
|
||||
super._preCreate(data, changes, user);
|
||||
async _preCreate(data, options, user) {
|
||||
if ( (await super._preCreate(data, options, user)) === false ) return false;
|
||||
|
||||
// Configure prototype token settings
|
||||
const prototypeToken = {};
|
||||
if ( this.type === "pc" ) Object.assign(prototypeToken, {
|
||||
sight: { enabled: true }, actorLink: true, disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
||||
});
|
||||
this.updateSource({ prototypeToken });
|
||||
}
|
||||
|
||||
prepareData() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue