Fixed heal flag (for max. player health(20))

This commit is contained in:
DarkLiKally 2011-03-01 15:18:34 +01:00
parent 20f91b5258
commit 59a1726e8c

View File

@ -88,7 +88,13 @@ public void run() {
healDelay *= 1000;
int healAmount = regions.getIntegerFlag(FlagType.HEAL_AMOUNT, true).getValue(1);
if (now - nfo.lastHealTick > healDelay) {
player.setHealth(player.getHealth() + healAmount);
if (player.getHealth() < 20) {
if (player.getHealth() + healAmount > 20) {
player.setHealth(20);
} else {
player.setHealth(player.getHealth() + healAmount);
}
}
} else {
nfo.sheduledHealTick = now + healDelay;
nfo.sheduledHealAmount = healAmount;