From aab133053165d51506eae3464ac9abca1d34e2c1 Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Mon, 18 Aug 2025 16:52:59 +0700 Subject: [PATCH] chore: Use `.set()` instead of getting a new instance of flxpoint, also add an if statement for better clarity! woo! --- source/funkin/play/components/HealthIcon.hx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/components/HealthIcon.hx b/source/funkin/play/components/HealthIcon.hx index 236ea4805..a0a3b917e 100644 --- a/source/funkin/play/components/HealthIcon.hx +++ b/source/funkin/play/components/HealthIcon.hx @@ -184,7 +184,7 @@ class HealthIcon extends FunkinSprite loadCharacter(characterId); this.size.set(1.0, 1.0); - iconOffset = FlxPoint.get(); + this.iconOffset.set(); this.flipX = false; } else @@ -195,7 +195,15 @@ class HealthIcon extends FunkinSprite loadCharacter(characterId); this.size.set(data.scale ?? 1.0, data.scale ?? 1.0); - iconOffset = FlxPoint.get((data.offsets != null) ? data.offsets[0] : 0.0, (data.offsets != null) ? data.offsets[1] : 0.0); + if (data.offsets != null && data.offsets.length == 2) + { + this.iconOffset.set(data.offsets[0], data.offsets[1]); + } + else + { + this.iconOffset.set(0, 0); + } + this.flipX = data.flipX ?? false; // Face the OTHER way by default, since that is more common. } }