Fix conteneur/objet

This commit is contained in:
2021-03-25 19:03:28 +01:00
parent 5b53d4c2c9
commit 5de4dd016f
2 changed files with 15 additions and 14 deletions

View File

@ -262,9 +262,10 @@ export class RdDUtility {
/* -------------------------------------------- */
static async processItemDropEvent(actorSheet, event) {
let dragData = JSON.parse(event.dataTransfer.getData("text/plain"));
console.log(dragData, actorSheet.actor._id);
console.log(dragData, actorSheet.actor.id);
let dropID = $(event.target).parents(".item").attr("data-item-id"); // Only relevant if container drop
let objetId = dragData.id || dragData.data._id;
console.log("DRAG", dragData);
if (dragData.type == 'Item') {
if (dropID) { // Dropped over an item !!!
if (actorSheet.objetVersConteneur[objetId] != dropID && objetId != dropID) {
@ -274,7 +275,7 @@ export class RdDUtility {
}
}
}
if (dragData.actorId && dragData.actorId != actorSheet.actor._id) { // Un acteur est à l'origine de l'item -> deplacement
if (dragData.actorId && dragData.actorId != actorSheet.actor.id) { // Un acteur est à l'origine de l'item -> deplacement
console.log("Moving objects");
actorSheet.actor.moveItemsBetweenActors(objetId, dragData.actorId);
return false;