12.0.5 - Les mauvais jours d'Astrobazzarh #706

Merged
uberwald merged 5 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-07-08 22:14:16 +02:00
Showing only changes of commit 8561e3f8bc - Show all commits

View File

@ -232,11 +232,13 @@ export class RdDBaseActor extends Actor {
/* -------------------------------------------- */
async cleanupConteneurs() {
let updates = this.itemTypes['conteneur']
.filter(c => c.system.contenu.filter(id => this.getItem(id) == undefined).length > 0)
.map(c => { return { _id: c._id, 'system.contenu': c.system.contenu.filter(id => this.getItem(id) != undefined) } });
if (updates.length > 0) {
await this.updateEmbeddedDocuments("Item", updates)
if (Misc.isOwnerPlayerOrUniqueConnectedGM(this)) {
let updates = this.itemTypes['conteneur']
.filter(c => c.system.contenu.filter(id => this.getItem(id) == undefined).length > 0)
.map(c => { return { _id: c._id, 'system.contenu': c.system.contenu.filter(id => this.getItem(id) != undefined) } });
if (updates.length > 0) {
await this.updateEmbeddedDocuments("Item", updates)
}
}
}