stop eating damaging players

This commit is contained in:
darkrose 2014-09-30 19:06:24 +10:00
parent 121b01ccdf
commit 06e277c949
1 changed files with 2 additions and 0 deletions

View File

@ -258,6 +258,8 @@ bool CraftItem::use(ServerEnvironment *env, Player *player)
if (player->hunger + (hp_change*2) > 20) {
hp_change -= 20-player->hunger;
player->hunger = 20;
if (hp_change < 0)
hp_change = 0;
}else{
player->hunger += (hp_change*2);
hp_change = 0;