summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-11-01 15:20:13 +0100
committerworktycho <work.tycho@gmail.com>2015-11-01 15:20:13 +0100
commit2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0 (patch)
treea82dde07e01e9bc1863bcdcd23146938563176c6 /src
parentFixed typo that slipped through #2584 (diff)
parentImplemented the Water Breathing Potion functionality. (diff)
downloadcuberite-2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0.tar
cuberite-2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0.tar.gz
cuberite-2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0.tar.bz2
cuberite-2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0.tar.lz
cuberite-2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0.tar.xz
cuberite-2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0.tar.zst
cuberite-2c5c4fa03d5f0d1d70e8fd6a5493d33416ed71b0.zip
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Pawn.cpp15
-rw-r--r--src/Entities/Pawn.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 9045f8595..126947d3e 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -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:
diff --git a/src/Entities/Pawn.h b/src/Entities/Pawn.h
index 40ce9b2dd..67878f699 100644
--- a/src/Entities/Pawn.h
+++ b/src/Entities/Pawn.h
@@ -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