Browse Source

Merge branch 'opfor' into opforfixed

opforfixed
Andrey Akhmichin 2 years ago
parent
commit
61b88514cf
No known key found for this signature in database
GPG Key ID: 1F180D249B0643C0
  1. 9
      dlls/gearbox/fgrunt.cpp
  2. 2
      dlls/player.cpp

9
dlls/gearbox/fgrunt.cpp

@ -3634,11 +3634,16 @@ bool CMedic::Heal( void ) @@ -3634,11 +3634,16 @@ bool CMedic::Heal( void )
if ( !HasHealCharge() || !HasHealTarget() )
return false;
Vector target = m_hTargetEnt->pev->origin - pev->origin;
CBaseEntity* pTargetEnt = m_hTargetEnt;
Vector target = pTargetEnt->pev->origin - pev->origin;
if ( target.Length() > 100 )
return false;
m_flHealCharge -= m_hTargetEnt->TakeHealth( Q_min(10, m_flHealCharge), DMG_GENERIC );
const float maxHeal = Q_min(10, m_flHealCharge);
const float diff = pTargetEnt->pev->max_health - pTargetEnt->pev->health;
const int healAmount = static_cast<int>(Q_min(maxHeal, diff)); // cast to avoid player having non-integer hp
pTargetEnt->TakeHealth( healAmount, DMG_GENERIC );
m_flHealCharge -= healAmount;
ALERT(at_aiconsole, "Medic grunt heal charge left: %f\n", m_flHealCharge);
m_fHealing = TRUE;
return true;

2
dlls/player.cpp

@ -1839,6 +1839,8 @@ void CBasePlayer::PreThink( void ) @@ -1839,6 +1839,8 @@ void CBasePlayer::PreThink( void )
m_afButtonPressed = buttonsChanged & pev->button; // The changed ones still down are "pressed"
m_afButtonReleased = buttonsChanged & ( ~pev->button ); // The ones not down are "released"
GlowShellUpdate();
g_pGameRules->PlayerThink( this );
if( g_fGameOver )

Loading…
Cancel
Save