Added SendEntityEffect and SendRemoveEntityEffect. Also a Player now gets the hunger effect when he has food poison.
This commit is contained in:
@@ -557,9 +557,13 @@ void cPlayer::FoodPoison(int a_NumTicks)
|
||||
m_FoodPoisonedTicksRemaining = std::max(m_FoodPoisonedTicksRemaining, a_NumTicks);
|
||||
if (!HasBeenFoodPoisoned)
|
||||
{
|
||||
// TODO: Send the poisoning indication to the client - how?
|
||||
m_ClientHandle->SendRemoveEntityEffect(*this, 17);
|
||||
SendHealth();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ClientHandle->SendEntityEffect(*this, 17, 0, 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1704,6 +1708,10 @@ void cPlayer::HandleFood(void)
|
||||
m_FoodPoisonedTicksRemaining--;
|
||||
m_FoodExhaustionLevel += 0.025; // 0.5 per second = 0.025 per tick
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ClientHandle->SendRemoveEntityEffect(*this, 17); // remove the "Hunger" effect.
|
||||
}
|
||||
|
||||
// Apply food exhaustion that has accumulated:
|
||||
if (m_FoodExhaustionLevel >= 4)
|
||||
|
||||
Reference in New Issue
Block a user