Fixed: #962 animal consumes one unit too many (by nimetu)

This commit is contained in:
vl 2010-06-08 16:34:28 +02:00
parent 18690cf985
commit 264dff494f

View file

@ -5660,7 +5660,8 @@ bool CCharacter::onAnimalHungry( uint petIndex, bool justBecameHungry )
{
// Consume to full satiety (last useful unit is entirely consumed)
animal.Satiety = animal.MaxSatiety;
nbUnits = (sint)((caloriesNeeded / caloriesPerUnit) + 1);
nbUnits = (sint)ceil(caloriesNeeded / caloriesPerUnit);
}
nbItemsLeftToConsume -= nbUnits;