bugfix when setting a new icon on the same hp

This commit is contained in:
⍚~Nex
2024-10-25 01:11:45 +02:00
parent 753404bb79
commit 08179b124d
+4 -5
View File
@@ -85,12 +85,11 @@ class HealthIcon extends FlxSprite
if (animation.curAnim != null) {
var i:Int = -1;
var oldKey:Int = -1;
for(k=>icon in healthSteps) {
if (k > oldKey && k < health * 100) {
oldKey = k;
i = icon;
}
for (k=>icon in healthSteps) if (k > oldKey && k <= health * 100) {
oldKey = k;
i = icon;
}
if (i >= 0) animation.curAnim.curFrame = i;
}
}