Cuberite Forum

Full Version: Hunger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I've created a patch for rudimentary hunger management.
Eating food will saturate the food bar, but healing from the food bar isn't implemented yet.

Patch made against latest svn rev 154
(Had to add .txt for the forum)
Added, good start, thanks.
I think it should be outsourced a bit.
The clienthandle is already very overloadedBig Grin

For example:

if(SomeClass::IsFood(Item->m_ItemID))
{
if(m_Player->GetInventory().RemoveItem( Item )
m_Player->Feed(SomeClass::GetSaturation(Item->m_ItemID));
break;
}

This would make the cClientHandle a bit clearer Smile
It could probably do with some refactoring later on. I was in fact a tad confused about how things were organized.
Yes I also realized this.
Therefore I mentioned this point because we should try to clean up the code bit by bit.

Wink