mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 15:45:41 +03:00
Fix bot: do reset of the target when are the target (player or bot) left the game.
This commit is contained in:
parent
507688c745
commit
cd96c9133d
@ -1500,3 +1500,23 @@ void CCSBotManager::ResetRadioMessageTimestamps()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCSBotManager::OnFreeEntPrivateData(CBaseEntity *pEntity)
|
||||
{
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
{
|
||||
CBasePlayer *pPlayer = UTIL_PlayerByIndex(i);
|
||||
if (!pPlayer || pPlayer->IsDormant())
|
||||
continue;
|
||||
|
||||
if (pPlayer->IsBot())
|
||||
{
|
||||
CCSBot *pBot = static_cast<CCSBot *>(pPlayer);
|
||||
if (pBot->m_attacker == pEntity)
|
||||
pBot->m_attacker = NULL;
|
||||
|
||||
if (pBot->m_bomber == pEntity)
|
||||
pBot->m_bomber = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
|
||||
public:
|
||||
void ValidateMapData();
|
||||
void OnFreeEntPrivateData(CBaseEntity *pEntity);
|
||||
bool IsLearningMap() const { return IMPL(m_isLearningMap); }
|
||||
void SetLearningMapFlag() { IMPL(m_isLearningMap) = true; }
|
||||
bool IsAnalysisRequested() const { return IMPL(m_isAnalysisRequested); }
|
||||
|
@ -456,7 +456,6 @@ void AttackState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
|
||||
if (gpGlobals->time > m_reacquireTimestamp)
|
||||
me->FireWeaponAtEnemy();
|
||||
|
||||
|
||||
// do dodge behavior
|
||||
// If sniping or crouching, stand still.
|
||||
if (m_dodge && !me->IsUsingSniperRifle() && !m_crouchAndHold)
|
||||
|
@ -1067,4 +1067,9 @@ void EXT_FUNC OnFreeEntPrivateData(edict_t *pEnt)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
if (TheCSBots()) {
|
||||
TheCSBots()->OnFreeEntPrivateData(pEntity);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user