Gestion de la capacité des conteneurs et regression fix

This commit is contained in:
2020-11-15 09:35:05 +01:00
parent 559e0b687e
commit f73f00fd4e
3 changed files with 30 additions and 4 deletions

View File

@ -169,8 +169,12 @@ export class RdDActorSheet extends ActorSheet {
if ( dropID ) { // Dropped over an item !!!
let objetId = dragData.id || dragData.data._id;
if ( this.objetVersConteneur[objetId] != dropID ) {
this.actor.enleverDeConteneur(objetId, this.objetVersConteneur[objetId]);
this.actor.ajouterAConteneur(objetId, dropID);
if ( this.actor.testConteneurCapacite(objetId, dropID) ) {
this.actor.enleverDeConteneur(objetId, this.objetVersConteneur[objetId]);
this.actor.ajouterAConteneur(objetId, dropID);
} else {
ui.notifications.info("Capacité d'encombrement insuffisante dans le conteneur !");
}
}
}
console.log("DATA !!!!", dragData, dropID );