From 5aebbd6d4a09ce197bb76d7f9b062a52c550e3c8 Mon Sep 17 00:00:00 2001 From: cailean Date: Thu, 27 Nov 2025 23:48:29 +0000 Subject: [PATCH] divie by 0 --- js/Item.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/Item.js b/js/Item.js index 6b32dd7..0452ce4 100644 --- a/js/Item.js +++ b/js/Item.js @@ -436,8 +436,11 @@ export class Item { this.hoverIndicator.scale.set(desiredScale, desiredScale, desiredScale); // Counteract the parent's scale by dividing the indicator's scale by the parent's scale. - if (this.object.scale.x !== 0 && this.object.scale.y !== 0 && this.object.scale.z !== 0) { - this.hoverIndicator.scale.divide(this.object.scale); + if (scale.x !== 0 && scale.y !== 0 && scale.z !== 0) { + this.hoverIndicator.scale.divide(scale); + } else { + // Avoid division by zero + this.hoverIndicator.scale.set(1, 1, 1); } // Position the sprite at the center of the object, in local space.