Unified cPlayer's Heal() function with cEntity's.
This commit is contained in:
parent
54f5f71c9a
commit
d359c5a2fe
@ -349,11 +349,8 @@ 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());
|
||||
SendHealth();
|
||||
}
|
||||
super::Heal(a_Health);
|
||||
SendHealth();
|
||||
}
|
||||
|
||||
|
||||
|
@ -167,21 +167,23 @@ 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; }
|
||||
double GetFoodExhaustionLevel (void) const { return m_FoodExhaustionLevel; }
|
||||
int GetFoodPoisonedTicksRemaining(void) const { return m_FoodPoisonedTicksRemaining; }
|
||||
|
||||
int GetAirLevel (void) const { return m_AirLevel; }
|
||||
int GetAirLevel (void) const { return m_AirLevel; }
|
||||
|
||||
/// Returns true if the player is satiated, i. e. their foodlevel is at the max and they cannot eat anymore
|
||||
bool IsSatiated(void) const { return (m_FoodLevel >= MAX_FOOD_LEVEL); }
|
||||
@ -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