Fix #6 Crew limits

This commit is contained in:
sladecraven 2022-09-25 14:51:43 +02:00
parent 857f36387a
commit 241c7fa1ae
2 changed files with 8 additions and 5 deletions

View File

@ -743,17 +743,20 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getSubActors() { getSubActors() {
let subActors = []; let subActors = [];
for (let id of this.system.subactors) { if (this.system.subactors) {
subActors.push(duplicate(game.actors.get(id))) for (let id of this.system.subactors) {
subActors.push(duplicate(game.actors.get(id)))
}
} }
return subActors; return subActors;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async addSubActor(subActorId) { async addSubActor(subActorId) {
let subActors = duplicate(this.system.subactors); let subActors = duplicate(this.system.subactors || []);
subActors.push(subActorId); subActors.push(subActorId);
await this.update({ 'system.subactors': subActors }); await this.update({ 'system.subactors': subActors });
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async delSubActor(subActorId) { async delSubActor(subActorId) {
let newArray = []; let newArray = [];

View File

@ -253,7 +253,7 @@
], ],
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "10.0.14", "version": "10.0.15",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.14.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.15.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
} }