fix: do not overwrite CC4::Think()

Co-authored-by: Garey27 <ak.garey@gmail.com>
Co-authored-by: s1lentq <s1lentsk@yandex.ru>
This commit is contained in:
Sergey Shorokhov 2022-12-21 22:52:46 +03:00
parent 889edc81bf
commit d97482640a
2 changed files with 3 additions and 7 deletions

View File

@ -870,7 +870,6 @@ public:
virtual BOOL Deploy();
virtual void Holster(int skiplocal);
virtual void AttachToPlayer(CBasePlayer* pPlayer);
virtual void Think();
virtual float GetMaxSpeed();
virtual int iItemSlot() { return C4_SLOT; }
virtual void PrimaryAttack();
@ -884,6 +883,7 @@ public:
#endif
}
void EXPORT TrackPlayerHeldPosition();
Vector GetLastValidHeldPosition() const { return m_vecLastValidPlayerHeldPosition; }
public:

View File

@ -388,7 +388,7 @@ void CC4::AttachToPlayer(CBasePlayer* pPlayer)
CBasePlayerWeapon::AttachToPlayer(pPlayer);
#ifdef REGAMEDLL_ADD
SetThink(&CC4::Think);
SetThink(&CC4::TrackPlayerHeldPosition);
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;
if (pPlayer->IsPlayer() && pPlayer->IsAlive())
@ -399,9 +399,8 @@ void CC4::AttachToPlayer(CBasePlayer* pPlayer)
#endif
}
void CC4::Think()
void CC4::TrackPlayerHeldPosition()
{
#ifdef REGAMEDLL_ADD
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;
// If the bomb is held by an alive player standing on the ground, then we can use this
@ -412,7 +411,4 @@ void CC4::Think()
entvars_t* pevPlayer = m_pPlayer->pev;
m_vecLastValidPlayerHeldPosition = pevPlayer->origin + pevPlayer->mins;
}
#else
CBasePlayerWeapon::Think();
#endif
}