diff --git a/regamedll/dlls/bot/cs_bot.cpp b/regamedll/dlls/bot/cs_bot.cpp index b0a48472..838387a9 100644 --- a/regamedll/dlls/bot/cs_bot.cpp +++ b/regamedll/dlls/bot/cs_bot.cpp @@ -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()) diff --git a/regamedll/dlls/bot/cs_bot.h b/regamedll/dlls/bot/cs_bot.h index 345e11fb..9670744f 100644 --- a/regamedll/dlls/bot/cs_bot.h +++ b/regamedll/dlls/bot/cs_bot.h @@ -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 diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index 345ae31f..78ce0cf5 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -408,10 +408,9 @@ void CCSBotManager::ServerCommand(const char *pcmd) if (pPlayer->IsBot()) { + CCSBot *pBot = static_cast(pPlayer); if (killThemAll || FStrEq(name, msg)) - { - pPlayer->Kill(); - } + pBot->Kill(); } } }