mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Bot fixes (#659)
* Bots only attack breakable objects * Fix reversing-engineering mistake
This commit is contained in:
parent
7e2279f8c5
commit
5aec8aac7e
@ -295,6 +295,15 @@ void CCSBot::BotTouch(CBaseEntity *pOther)
|
|||||||
// See if it's breakable
|
// See if it's breakable
|
||||||
if (FClassnameIs(pOther->pev, "func_breakable"))
|
if (FClassnameIs(pOther->pev, "func_breakable"))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
CBreakable *pBreak = static_cast<CBreakable *>(pOther);
|
||||||
|
|
||||||
|
// Material is "UnbreakableGlass"
|
||||||
|
if (!pBreak->IsBreakable())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
Vector center = (pOther->pev->absmax + pOther->pev->absmin) / 2.0f;
|
Vector center = (pOther->pev->absmax + pOther->pev->absmin) / 2.0f;
|
||||||
bool breakIt = true;
|
bool breakIt = true;
|
||||||
|
|
||||||
|
@ -69,16 +69,18 @@ void CCSBot::OnEvent(GameEventType event, CBaseEntity *pEntity, CBaseEntity *pOt
|
|||||||
{
|
{
|
||||||
if (event == EVENT_PLAYER_DIED)
|
if (event == EVENT_PLAYER_DIED)
|
||||||
{
|
{
|
||||||
if (BotRelationship(pPlayer) == BOT_TEAMMATE)
|
CBasePlayer *pVictim = pPlayer;
|
||||||
|
|
||||||
|
if (BotRelationship(pVictim) == BOT_TEAMMATE)
|
||||||
{
|
{
|
||||||
CBasePlayer *pKiller = static_cast<CBasePlayer *>(pOther);
|
CBasePlayer *pKiller = static_cast<CBasePlayer *>(pOther);
|
||||||
|
|
||||||
// check that attacker is an enemy (for friendly fire, etc)
|
// check that attacker is an enemy (for friendly fire, etc)
|
||||||
if (pKiller && pKiller->IsPlayer())
|
if (pKiller && pKiller->IsPlayer() && BotRelationship(pKiller) == BOT_ENEMY)
|
||||||
{
|
{
|
||||||
// check if we saw our friend die - dont check FOV - assume we're aware of our surroundings in combat
|
// check if we saw our friend die - dont check FOV - assume we're aware of our surroundings in combat
|
||||||
// snipers stay put
|
// snipers stay put
|
||||||
if (!IsSniper() && IsVisible(&pPlayer->pev->origin))
|
if (!IsSniper() && IsVisible(&pVictim->pev->origin))
|
||||||
{
|
{
|
||||||
// people are dying - we should hurry
|
// people are dying - we should hurry
|
||||||
Hurry(RANDOM_FLOAT(10.0f, 15.0f));
|
Hurry(RANDOM_FLOAT(10.0f, 15.0f));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user