Improve cloning-detection in the preCreate hook so that we can ignore duplications for creating attribute items
This commit is contained in:
parent
71fce2c0ca
commit
153f48a7c3
2 changed files with 11 additions and 1 deletions
|
|
@ -15,6 +15,16 @@ export class TAFActor extends Actor {
|
|||
super._onEmbeddedDocumentChange(...args);
|
||||
this.#sortedTypes = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* This override allows the _preCreate operations to see whether the actor is
|
||||
* being cloned or created from nothing. This allows for easy one-time operations
|
||||
* that should be performed during Actor creation but not duplication to occur.
|
||||
*/
|
||||
clone(data, context) {
|
||||
context.cloning = true;
|
||||
return super.clone(data, context);
|
||||
};
|
||||
// #endregion Lifecycle
|
||||
|
||||
// #region Token Attributes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue