Unified cPlayer's Heal() function with cEntity's.
This commit is contained in:
parent
54f5f71c9a
commit
d359c5a2fe
@ -349,12 +349,9 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
|
||||
|
||||
void cPlayer::Heal(int a_Health)
|
||||
{
|
||||
if (m_Health < GetMaxHealth())
|
||||
{
|
||||
m_Health = (short)std::min((int)a_Health + m_Health, (int)GetMaxHealth());
|
||||
super::Heal(a_Health);
|
||||
SendHealth();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -167,14 +167,16 @@ public:
|
||||
StringList GetResolvedPermissions(); // >> EXPORTED IN MANUALBINDINGS <<
|
||||
bool IsInGroup( const AString & a_Group ); // tolua_export
|
||||
|
||||
AString GetColor(void) const; // tolua_export
|
||||
|
||||
void TossItem(bool a_bDraggingItem, char a_Amount = 1, short a_CreateType = 0, short a_CreateHealth = 0); // tolua_export
|
||||
|
||||
void Heal( int a_Health ); // tolua_export
|
||||
|
||||
// tolua_begin
|
||||
|
||||
/// Returns the full color code to use for this player, based on their primary group or set in m_Color
|
||||
AString GetColor(void) const;
|
||||
|
||||
void TossItem(bool a_bDraggingItem, char a_Amount = 1, short a_CreateType = 0, short a_CreateHealth = 0);
|
||||
|
||||
/// Heals the player by the specified amount of HPs (positive only); sends health update
|
||||
void Heal(int a_Health);
|
||||
|
||||
int GetFoodLevel (void) const { return m_FoodLevel; }
|
||||
double GetFoodSaturationLevel (void) const { return m_FoodSaturationLevel; }
|
||||
int GetFoodTickTimer (void) const { return m_FoodTickTimer; }
|
||||
@ -302,6 +304,7 @@ protected:
|
||||
|
||||
/// Player's air level (for swimming)
|
||||
int m_AirLevel;
|
||||
|
||||
/// used to time ticks between damage taken via drowning/suffocation
|
||||
int m_AirTickTimer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user