bugfix when setting a new icon on the same hp
This commit is contained in:
@@ -85,12 +85,11 @@ class HealthIcon extends FlxSprite
|
|||||||
if (animation.curAnim != null) {
|
if (animation.curAnim != null) {
|
||||||
var i:Int = -1;
|
var i:Int = -1;
|
||||||
var oldKey:Int = -1;
|
var oldKey:Int = -1;
|
||||||
for(k=>icon in healthSteps) {
|
for (k=>icon in healthSteps) if (k > oldKey && k <= health * 100) {
|
||||||
if (k > oldKey && k < health * 100) {
|
oldKey = k;
|
||||||
oldKey = k;
|
i = icon;
|
||||||
i = icon;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i >= 0) animation.curAnim.curFrame = i;
|
if (i >= 0) animation.curAnim.curFrame = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user