From 80f6f82d19ba2c9afb8b78de75a1504c4495c0a4 Mon Sep 17 00:00:00 2001 From: Damian-I Date: Sun, 9 Mar 2025 17:09:43 +0000 Subject: [PATCH] Improve interaction range logging and update interaction handling method --- index.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 29a1487..803f159 100644 --- a/index.html +++ b/index.html @@ -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() {