Skip to content

Commit

Permalink
Do not reduce points for bot suicide due bot_kill command
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jan 31, 2024
1 parent 0bbc4bd commit 5287f2a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
14 changes: 14 additions & 0 deletions regamedll/dlls/bot/cs_bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 4 additions & 0 deletions regamedll/dlls/bot/cs_bot.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ class CCSBot: public CBot

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
Expand Down
5 changes: 2 additions & 3 deletions regamedll/dlls/bot/cs_bot_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down

0 comments on commit 5287f2a

Please sign in to comment.