Skip to content

Commit

Permalink
bugfix when setting a new icon on the same hp
Browse files Browse the repository at this point in the history
  • Loading branch information
NexIsDumb committed Oct 24, 2024
1 parent 753404b commit 08179b1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions source/funkin/game/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 08179b1

Please sign in to comment.