Do not reduce points for bot suicide due bot_kill command

This commit is contained in:
s1lentq 2024-01-31 19:16:37 +07:00
parent 0bbc4bd55d
commit 5287f2a415
3 changed files with 20 additions and 3 deletions

View File

@ -429,6 +429,20 @@ bool CCSBot::StayOnNavMesh()
return false;
}
#ifdef REGAMEDLL_FIXES
void CCSBot::Kill()
{
m_LastHitGroup = HITGROUP_GENERIC;
// have the player kill himself
pev->health = 0.0f;
Killed(VARS(eoNullEntity), GIB_NEVER);
if (CSGameRules()->m_pVIP == this)
CSGameRules()->m_iConsecutiveVIP = 10;
}
#endif
void CCSBot::Panic(CBasePlayer *pEnemy)
{
if (IsSurprised())

View File

@ -375,6 +375,10 @@ public:
bool IsBuying() const;
#ifdef REGAMEDLL_FIXES
void Kill();
#endif
void Panic(CBasePlayer *pEnemy); // look around in panic
void Follow(CBasePlayer *pPlayer); // begin following given Player
void ContinueFollowing(); // continue following our leader after finishing what we were doing

View File

@ -408,10 +408,9 @@ void CCSBotManager::ServerCommand(const char *pcmd)
if (pPlayer->IsBot())
{
CCSBot *pBot = static_cast<CCSBot *>(pPlayer);
if (killThemAll || FStrEq(name, msg))
{
pPlayer->Kill();
}
pBot->Kill();
}
}
}