1
0

Implemented the Water Breathing Potion functionality.

Fixes #2556
This commit is contained in:
bibo38 2015-11-01 11:50:03 +01:00
parent cb551e9512
commit 435bae104d
2 changed files with 16 additions and 0 deletions

View File

@ -70,6 +70,21 @@ bool cPawn::IsFireproof(void) const
void cPawn::HandleAir(void)
{
if (IsSubmerged() && HasEntityEffect(cEntityEffect::effWaterBreathing))
{
// Prevent the oxygen from decreasing
return;
}
super::HandleAir();
}
void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier)
{
// Check if the plugins allow the addition:

View File

@ -24,6 +24,7 @@ public:
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
virtual bool IsFireproof(void) const override;
virtual void HandleAir(void) override;
// tolua_begin