Add bow charging animation
This commit is contained in:
parent
4fddbf9dfc
commit
e50423991e
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
||||||
|
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
@ -411,6 +411,7 @@ void cPlayer::StartChargingBow(void)
|
|||||||
LOGD("Player \"%s\" started charging their bow", GetName().c_str());
|
LOGD("Player \"%s\" started charging their bow", GetName().c_str());
|
||||||
m_IsChargingBow = true;
|
m_IsChargingBow = true;
|
||||||
m_BowCharge = 0;
|
m_BowCharge = 0;
|
||||||
|
m_World->BroadcastEntityMetadata(*this, m_ClientHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -423,6 +424,8 @@ int cPlayer::FinishChargingBow(void)
|
|||||||
int res = m_BowCharge;
|
int res = m_BowCharge;
|
||||||
m_IsChargingBow = false;
|
m_IsChargingBow = false;
|
||||||
m_BowCharge = 0;
|
m_BowCharge = 0;
|
||||||
|
m_World->BroadcastEntityMetadata(*this, m_ClientHandle);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,6 +438,7 @@ void cPlayer::CancelChargingBow(void)
|
|||||||
LOGD("Player \"%s\" cancelled charging their bow at a charge of %d", GetName().c_str(), m_BowCharge);
|
LOGD("Player \"%s\" cancelled charging their bow at a charge of %d", GetName().c_str(), m_BowCharge);
|
||||||
m_IsChargingBow = false;
|
m_IsChargingBow = false;
|
||||||
m_BowCharge = 0;
|
m_BowCharge = 0;
|
||||||
|
m_World->BroadcastEntityMetadata(*this, m_ClientHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ public:
|
|||||||
// cEntity overrides:
|
// cEntity overrides:
|
||||||
virtual bool IsCrouched (void) const { return m_IsCrouched; }
|
virtual bool IsCrouched (void) const { return m_IsCrouched; }
|
||||||
virtual bool IsSprinting(void) const { return m_IsSprinting; }
|
virtual bool IsSprinting(void) const { return m_IsSprinting; }
|
||||||
virtual bool IsRclking (void) const { return IsEating(); }
|
virtual bool IsRclking (void) const { return IsEating() || IsChargingBow(); }
|
||||||
|
|
||||||
virtual void Detach(void);
|
virtual void Detach(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user