1
0

Implemented proper player crouching.

Fixes FS #365

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1553 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-06-04 14:18:03 +00:00
parent 5fe0c3d375
commit dff77e8e56
6 changed files with 48 additions and 8 deletions

View File

@@ -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)