X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbattle%2FHero.h;h=69db286c74d32fb69fa64a8ffe575439e90c0d4b;hb=185c6c79f8ba30981aad4e1d66f98143a344b95e;hp=d7f6a49d97b0a89efaeffe8c752d46db5484f922;hpb=e70b263430990055abc58945aa385e52d935431d;p=l2e.git diff --git a/src/battle/Hero.h b/src/battle/Hero.h index d7f6a49..69db286 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -31,7 +31,8 @@ public: Uint16 MaxMana() const { return maxMana; } Uint16 Mana() const { return mana; } - int RelativeMana(int max) const { return mana * max / maxMana; } + int RelativeMana(int max) const { return maxMana == 0 ? 0 : mana * max / maxMana; } + bool CanUseMagic() const { return maxMana > 0; } Uint8 IP() const { return ip; } int RelativeIP(int max) const { return ip * max / 255; }