Some check on actor types

This commit is contained in:
Vlyan
2021-10-06 19:01:17 +02:00
parent 2ca33fa104
commit 967b2c7383
7 changed files with 270 additions and 8 deletions

View File

@@ -168,12 +168,18 @@ export class GmMonitor extends FormApplication {
return;
}
const actor = game.actors.filter((e) => e.id === data.id);
const actor = game.actors.find((e) => e.id === data.id);
if (!actor) {
return;
}
this.object.actors.push(actor[0]);
// No armies allowed !
if (actor.data.type === "army") {
console.log(`L5R5E | Armies are not supported !`);
return;
}
this.object.actors.push(actor);
return this._saveActorsIds();
}