Fix Chèvre-pieds et autres #482

Merged
vincent.vandeme merged 1 commits from v1.4-fix-humanoides into v1.4 2021-06-03 08:53:35 +02:00

View File

@ -195,9 +195,15 @@ export class RdDItem extends Item {
if (itemData.name != otherData.name) return false;
if (tplData.quantite == undefined) return false;
for (const [key, value] of Object.entries(tplData)) {
if (['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key)) continue;
if (value != otherTplData[key]) return false;
const differences = Object.entries(tplData).filter(([key, value]) => !['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key))
.filter(([key, value]) => value != otherTplData[key]);
if (differences.length > 0) {
let message = `Impossible de regrouper les ${itemData.type} ${itemData.name}: `;
for (const [key, value] of differences){
message += `<br>${key}: ${value} vs ${otherTplData[key]}`;
}
ui.notifications.info(message)
return false;
}
return true;
}