On ne peut pas tout donner

Limitation des types d'objets pouvant être donnés à différents acteurs
This commit is contained in:
Vincent Vandemeulebrouck
2022-12-03 15:33:16 +01:00
parent eaac9564b4
commit b1e27a9597
10 changed files with 116 additions and 76 deletions

View File

@ -132,10 +132,12 @@ export class RdDActorSheet extends ActorSheet {
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
const destItemId = $(event.target)?.closest('.item').attr('data-item-id')
const dropParams = RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor.id, dragData, this.objetVersConteneur)
const callSuper = await this.actor.processDropItem(dropParams)
if (callSuper) {
await super._onDropItem(event, dragData)
const dropParams = RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor, dragData, this.objetVersConteneur)
if (dropParams){
const callSuper = await this.actor.processDropItem(dropParams)
if (callSuper) {
await super._onDropItem(event, dragData)
}
}
}