Improve interaction range logging and update interaction handling method

This commit is contained in:
Damian-I
2025-03-09 17:09:43 +00:00
parent 03cc85685d
commit 80f6f82d19

View File

@@ -2675,8 +2675,12 @@
const distanceSq = dx * dx + dy * dy;
if (distanceSq > INTERACTION_RANGE_SQ) {
// Show notification instead of alert
//gameAlert("Too far away to interact with this object.", 'warning', '', 2000);
// Player is too far away to interact
debugLog('INTERACTION_OUT_OF_RANGE', {
objectName: sprite.name,
distance: Math.sqrt(distanceSq),
maxRange: Math.sqrt(INTERACTION_RANGE_SQ)
}, 2);
return;
}
}
@@ -2883,7 +2887,7 @@
}
// Handle other inventory items as before
handleItemInteraction(this, true);
handleObjectInteraction(this);
});
inventorySprite.on('pointerover', function() {