Add game.actors.party and refine logic

This commit is contained in:
Carlos Fernandez 2026-04-15 18:29:17 -04:00
parent b08b8b93b6
commit 031f497c33
5 changed files with 22 additions and 18 deletions

View file

@ -1,4 +1,11 @@
export default class DhActorCollection extends foundry.documents.collections.Actors {
/** @returns the active party */
get party() {
const id = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.ActiveParty);
const actor = game.actors.get(id);
return actor?.type === "party" ? actor : null;
}
/** Ensure companions are initialized after all other subtypes. */
_initialize() {
super._initialize();