Merge branch 'master-fix' into 'master'

Empêcher doublons sur tête/souffle #175

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!206
This commit is contained in:
Leratier Bretonnien 2021-04-17 07:18:31 +00:00
commit 2bca036d53
18 changed files with 39 additions and 32 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
icons/creatures/dong_t.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -3144,7 +3144,7 @@ export class RdDActor extends Actor {
} }
async onCreateOwnedDraconique(item, options, id) { async onCreateOwnedDraconique(item, options, id) {
if (Misc.isElectedUser()) {
let draconique = Draconique.all().find(it => it.match(item)); let draconique = Draconique.all().find(it => it.match(item));
if (draconique) { if (draconique) {
draconique.onActorCreateOwned(this, item) draconique.onActorCreateOwned(this, item)
@ -3152,21 +3152,24 @@ export class RdDActor extends Actor {
this.notifyGestionTeteSouffleQueue(item, draconique.manualMessage()); this.notifyGestionTeteSouffleQueue(item, draconique.manualMessage());
} }
} }
}
async onDeleteOwnedDraconique(item, options, id) { async onDeleteOwnedDraconique(item, options, id) {
if (Misc.isElectedUser()) {
let draconique = Draconique.all().find(it => it.match(item)); let draconique = Draconique.all().find(it => it.match(item));
if (draconique) { if (draconique) {
draconique.onActorDeleteOwned(this, item) draconique.onActorDeleteOwned(this, item)
} }
} }
}
async onDeleteOwnedCaseTmr(item, options, id) { async onDeleteOwnedCaseTmr(item, options, id) {
if (Misc.isElectedUser()) {
let draconique = Draconique.all().find(it => it.isCase(item)); let draconique = Draconique.all().find(it => it.isCase(item));
if (draconique) { if (draconique) {
draconique.onActorDeleteCaseTmr(this, item) draconique.onActorDeleteCaseTmr(this, item)
} }
} }
}
notifyGestionTeteSouffleQueue(item, manualMessage = true) { notifyGestionTeteSouffleQueue(item, manualMessage = true) {
ChatMessage.create({ ChatMessage.create({

View File

@ -115,4 +115,8 @@ export class Misc {
static templateData(it) { static templateData(it) {
return Misc.data(it)?.data ?? {} return Misc.data(it)?.data ?? {}
} }
static isElectedUser() {
return game.user.id == Misc.connectedGMOrUser();
}
} }

File diff suppressed because one or more lines are too long