diff options
author | Mattes D <github@xoft.cz> | 2013-12-15 15:52:39 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-12-15 15:52:39 +0100 |
commit | af4237de77e0ec36b9610eb81fffb424e88806c8 (patch) | |
tree | d6f1f1737388e7bf65a475a1396d30bed745094b /src/Entities/Player.cpp | |
parent | Merge pull request #432 from mc-server/Broadcast_Effects (diff) | |
parent | APIDump: Documented New functions (diff) | |
download | cuberite-af4237de77e0ec36b9610eb81fffb424e88806c8.tar cuberite-af4237de77e0ec36b9610eb81fffb424e88806c8.tar.gz cuberite-af4237de77e0ec36b9610eb81fffb424e88806c8.tar.bz2 cuberite-af4237de77e0ec36b9610eb81fffb424e88806c8.tar.lz cuberite-af4237de77e0ec36b9610eb81fffb424e88806c8.tar.xz cuberite-af4237de77e0ec36b9610eb81fffb424e88806c8.tar.zst cuberite-af4237de77e0ec36b9610eb81fffb424e88806c8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Player.cpp | 32 |
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) |