Some check on actor types
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -195,6 +195,12 @@ export class GmToolbox extends FormApplication {
|
||||
const type = $(event.currentTarget).data("type");
|
||||
|
||||
for await (const actor of game.actors.contents) {
|
||||
// Only characters types
|
||||
if (!["character", "npc"].includes(actor.data.type)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Manage left/right button
|
||||
if (!isAll && (actor.data.type !== "character" || !actor.hasPlayerOwner)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user