mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-04-16 06:22:27 +03:00
Fix the bots behavior when death bot_kill and mp_freeforall 1
This commit is contained in:
parent
183a9f674c
commit
8914b84129
@ -408,7 +408,6 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
const char *name = STRING(pPlayer->pev->netname);
|
const char *name = STRING(pPlayer->pev->netname);
|
||||||
|
|
||||||
if (FStrEq(name, ""))
|
if (FStrEq(name, ""))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -416,7 +415,11 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
|
|||||||
{
|
{
|
||||||
if (killThemAll || FStrEq(name, msg))
|
if (killThemAll || FStrEq(name, msg))
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
ClientKill(pPlayer->edict());
|
||||||
|
#else
|
||||||
pPlayer->TakeDamage(pPlayer->pev, pPlayer->pev, 9999.9f, DMG_CRUSH);
|
pPlayer->TakeDamage(pPlayer->pev, pPlayer->pev, 9999.9f, DMG_CRUSH);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1973,7 +1973,8 @@ bool BuyGunAmmo(CBasePlayer *player, CBasePlayerItem *weapon, bool bBlinkMoney)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
WeaponInfoStruct *info = GetWeaponInfo(weapon->m_iId);
|
WeaponInfoStruct *info = GetWeaponInfo(weapon->m_iId);
|
||||||
if (info == nullptr) {
|
if (!info)
|
||||||
|
{
|
||||||
ALERT(at_console, "Tried to buy ammo for an unrecognized gun\n");
|
ALERT(at_console, "Tried to buy ammo for an unrecognized gun\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -3569,7 +3569,7 @@ void CHalfLifeMultiplay::__API_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvars
|
|||||||
{
|
{
|
||||||
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
||||||
CBasePlayer *killer = GetClassPtr<CCSPlayer>((CBasePlayer *)pKiller);
|
CBasePlayer *killer = GetClassPtr<CCSPlayer>((CBasePlayer *)pKiller);
|
||||||
bool killedByFFA = CSGameRules()->IsFreeForAll();
|
bool killedByFFA = IsFreeForAll();
|
||||||
|
|
||||||
if (killer->m_iTeam == pVictim->m_iTeam && !killedByFFA)
|
if (killer->m_iTeam == pVictim->m_iTeam && !killedByFFA)
|
||||||
{
|
{
|
||||||
|
@ -1106,7 +1106,6 @@ BOOL CBasePlayer::__API_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool killedByHumanPlayer = (!pPlayer->IsBot() && pPlayer->pev == pevAttacker && pPlayer->m_iTeam != m_iTeam);
|
bool killedByHumanPlayer = (!pPlayer->IsBot() && pPlayer->pev == pevAttacker && pPlayer->m_iTeam != m_iTeam);
|
||||||
|
|
||||||
if (killedByHumanPlayer)
|
if (killedByHumanPlayer)
|
||||||
{
|
{
|
||||||
if (TheCareerTasks != NULL)
|
if (TheCareerTasks != NULL)
|
||||||
@ -2080,7 +2079,7 @@ void CBasePlayer::__API_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pTank != NULL)
|
if (m_pTank)
|
||||||
{
|
{
|
||||||
m_pTank->Use(this, this, USE_OFF, 0);
|
m_pTank->Use(this, this, USE_OFF, 0);
|
||||||
m_pTank = NULL;
|
m_pTank = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user