diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-04 16:18:03 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-04 16:18:03 +0200 |
commit | dff77e8e5690b7834652884aadf6c3d5e1ceafd9 (patch) | |
tree | 36e6ae622b45712b521683666c13661544c28733 /source/Player.cpp | |
parent | ProtoProxy: Added PACKET_SPAWN_NAMED_ENTITY and PACKET_PLAYER_ANIMATION parsing (diff) | |
download | cuberite-dff77e8e5690b7834652884aadf6c3d5e1ceafd9.tar cuberite-dff77e8e5690b7834652884aadf6c3d5e1ceafd9.tar.gz cuberite-dff77e8e5690b7834652884aadf6c3d5e1ceafd9.tar.bz2 cuberite-dff77e8e5690b7834652884aadf6c3d5e1ceafd9.tar.lz cuberite-dff77e8e5690b7834652884aadf6c3d5e1ceafd9.tar.xz cuberite-dff77e8e5690b7834652884aadf6c3d5e1ceafd9.tar.zst cuberite-dff77e8e5690b7834652884aadf6c3d5e1ceafd9.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Player.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/Player.cpp b/source/Player.cpp index dd71ca834..16255c003 100644 --- a/source/Player.cpp +++ b/source/Player.cpp @@ -50,6 +50,7 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) , m_ClientHandle( a_Client ) , m_FoodExhaustionLevel(0.f) , m_FoodTickTimer(0) + , m_IsCrouched(false) { LOGD("Created a player object for \"%s\" @ \"%s\" at %p, ID %d", a_PlayerName.c_str(), a_Client->GetIPString().c_str(), @@ -355,6 +356,23 @@ const cSlotNums & cPlayer::GetInventoryPaintSlots(void) const +void cPlayer::SetCrouch(bool a_IsCrouched) +{ + // Set the crouch status, broadcast to all visible players + + if (a_IsCrouched == m_IsCrouched) + { + // No change + return; + } + m_IsCrouched = a_IsCrouched; + m_World->BroadcastMetadata(*this); +} + + + + + void cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) { if (m_GameMode == eGameMode_Creative) |