munificent / hauberk

A web-based roguelike written in Dart.
http://munificent.github.io/hauberk/
Other
2k stars 200 forks source link

Fix crash upon reaching maximum hero level #26

Closed CyberShadow closed 7 years ago

CyberShadow commented 7 years ago

calculateLevelCost returns null when the given level is above the maximum one.

Avoid subtracting from null by omitting rendering of experience points when the hero level has reached its maximum value.

munificent commented 7 years ago

Thanks! I can confidently state that I have never once hit the maximum level of a hero, so there's not surprise that bugs lurk there. :)