summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-12-15 14:48:17 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-12-15 14:48:17 +0100
commitb10d0b95cbdce1d476f14415901c89bf324c0c18 (patch)
tree00aff412ae4fe7c691dc18f2fc3d6fd61dde8a60 /src/Entities/Player.cpp
parentMerge pull request #432 from mc-server/Broadcast_Effects (diff)
downloadcuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.gz
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.bz2
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.lz
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.xz
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.zst
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index e057c25fe..c2a76342d 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -63,6 +63,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
, m_IsSprinting(false)
, m_IsSwimming(false)
, m_IsSubmerged(false)
+ , m_IsFlying(false)
+ , m_CanFly(false)
, m_EatingFinishTick(-1)
, m_IsChargingBow(false)
, m_BowCharge(0)
@@ -751,6 +753,36 @@ void cPlayer::SetSprint(bool a_IsSprinting)
+void cPlayer::SetCanFly(bool a_CanFly)
+{
+ if (a_CanFly == m_CanFly)
+ {
+ return;
+ }
+
+ m_CanFly = a_CanFly;
+ m_ClientHandle->SendPlayerAbilities();
+}
+
+
+
+
+
+void cPlayer::SetFlying(bool a_IsFlying)
+{
+ if (a_IsFlying == m_IsFlying)
+ {
+ return;
+ }
+
+ m_IsFlying = a_IsFlying;
+ m_ClientHandle->SendPlayerAbilities();
+}
+
+
+
+
+
void cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
{
if (a_TDI.DamageType != dtInVoid)