mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
[Feature] 1541 - Trigger Improvements (#1542)
* Improved registration and unregistration of triggers * Added logging * Fixed Feature level unregistration * Fixed action deletion unregistration * SceneEnvironment stub * Update module/data/registeredTriggers.mjs Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com> --------- Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
parent
4cd6fe58da
commit
fad09a1b3a
8 changed files with 226 additions and 66 deletions
|
|
@ -104,6 +104,16 @@ export default class DhpActor extends Actor {
|
|||
}
|
||||
}
|
||||
|
||||
async _preDelete() {
|
||||
if (this.prototypeToken.actorLink) {
|
||||
game.system.registeredTriggers.unregisterItemTriggers(this.items);
|
||||
} else {
|
||||
for (const token of this.getActiveTokens()) {
|
||||
game.system.registeredTriggers.unregisterItemTriggers(token.actor.items);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_onDelete(options, userId) {
|
||||
super._onDelete(options, userId);
|
||||
for (const party of this.parties) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue