Fix #6 Crew limits

This commit is contained in:
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() {
let subActors = [];
for (let id of this.system.subactors) {
subActors.push(duplicate(game.actors.get(id)))
if (this.system.subactors) {
for (let id of this.system.subactors) {
subActors.push(duplicate(game.actors.get(id)))
}
}
return subActors;
}
/* -------------------------------------------- */
async addSubActor(subActorId) {
let subActors = duplicate(this.system.subactors);
let subActors = duplicate(this.system.subactors || []);
subActors.push(subActorId);
await this.update({ 'system.subactors': subActors });
}
/* -------------------------------------------- */
async delSubActor(subActorId) {
let newArray = [];