Merge pull request #2586 from bibo38/drownpotion
Implemented the Water Breathing Potion functionality.
This commit is contained in:
commit
2c5c4fa03d
@ -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)
|
void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier)
|
||||||
{
|
{
|
||||||
// Check if the plugins allow the addition:
|
// Check if the plugins allow the addition:
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
||||||
|
|
||||||
virtual bool IsFireproof(void) const override;
|
virtual bool IsFireproof(void) const override;
|
||||||
|
virtual void HandleAir(void) override;
|
||||||
|
|
||||||
// tolua_begin
|
// tolua_begin
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user