Skip to content

Commit

Permalink
WIP #12: Fix crash when node health changes to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Brindamour committed Aug 7, 2016
1 parent 685f3ec commit 9e3b4f4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public void updateHealth(float pct) {

this.healthPct = pct;

int texture_index = (int) (HEALTH_QUANTA * pct);
int texture_index = Math.min((int) (HEALTH_QUANTA * pct), HEALTH_QUANTA -1);
standardTexture = nodeTypeToStandardColorizedTextures.get(this.selectableType)[texture_index];
hoveredTexture = nodeTypeToHoveredColorizedTextures.get(this.selectableType)[texture_index];

Expand Down

0 comments on commit 9e3b4f4

Please sign in to comment.