Disable Hunger Death
This commit is contained in:
parent
52cd9dfe9f
commit
d15d6acc58
@ -1764,6 +1764,12 @@ void cPlayer::HandleFood(void)
|
|||||||
{
|
{
|
||||||
// Ref.: http://www.minecraftwiki.net/wiki/Hunger
|
// Ref.: http://www.minecraftwiki.net/wiki/Hunger
|
||||||
|
|
||||||
|
if (IsGameModeCreative())
|
||||||
|
{
|
||||||
|
// Hunger is disabled for Creative
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Remember the food level before processing, for later comparison
|
// Remember the food level before processing, for later comparison
|
||||||
int LastFoodLevel = m_FoodLevel;
|
int LastFoodLevel = m_FoodLevel;
|
||||||
|
|
||||||
@ -1781,7 +1787,7 @@ void cPlayer::HandleFood(void)
|
|||||||
Heal(1);
|
Heal(1);
|
||||||
m_FoodExhaustionLevel += 3;
|
m_FoodExhaustionLevel += 3;
|
||||||
}
|
}
|
||||||
else if (m_FoodLevel <= 0)
|
else if (m_FoodLevel <= 0 && m_Health > 1)
|
||||||
{
|
{
|
||||||
// Damage from starving
|
// Damage from starving
|
||||||
TakeDamage(dtStarving, NULL, 1, 1, 0);
|
TakeDamage(dtStarving, NULL, 1, 1, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user