From 264dff494f5e0889ba668ff538646bdfd97ef163 Mon Sep 17 00:00:00 2001 From: vl Date: Tue, 8 Jun 2010 16:34:28 +0200 Subject: [PATCH] Fixed: #962 animal consumes one unit too many (by nimetu) --- .../src/entities_game_service/player_manager/character.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 0288a67ef..f45122431 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -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;