X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.cpp;h=ab3b23e9b9c396e023516e539f640501a76ff831;hb=fbf5a98f8fd0da951e469003fe87d575a6bb30a4;hp=4bfdf0a0cf651e879cb80d7b1bad92e12effd892;hpb=c0068263474818f39e704eee12f753c0419f7708;p=l2e.git diff --git a/src/battle/Hero.cpp b/src/battle/Hero.cpp index 4bfdf0a..ab3b23e 100644 --- a/src/battle/Hero.cpp +++ b/src/battle/Hero.cpp @@ -45,4 +45,13 @@ Hero::~Hero() { } + +void Hero::SubtractHealth(int amount) { + if (amount > Health()) { + health = 0; + } else { + health -= amount; + } +} + }