diff --git a/regamedll/dlls/bot/cs_bot.cpp b/regamedll/dlls/bot/cs_bot.cpp index 660dc71bf..b0a484724 100644 --- a/regamedll/dlls/bot/cs_bot.cpp +++ b/regamedll/dlls/bot/cs_bot.cpp @@ -295,6 +295,15 @@ void CCSBot::BotTouch(CBaseEntity *pOther) // See if it's breakable if (FClassnameIs(pOther->pev, "func_breakable")) { + +#ifdef REGAMEDLL_FIXES + CBreakable *pBreak = static_cast(pOther); + + // Material is "UnbreakableGlass" + if (!pBreak->IsBreakable()) + return; +#endif + Vector center = (pOther->pev->absmax + pOther->pev->absmin) / 2.0f; bool breakIt = true; diff --git a/regamedll/dlls/bot/cs_bot_event.cpp b/regamedll/dlls/bot/cs_bot_event.cpp index 0c3fb6e69..199616659 100644 --- a/regamedll/dlls/bot/cs_bot_event.cpp +++ b/regamedll/dlls/bot/cs_bot_event.cpp @@ -69,16 +69,18 @@ void CCSBot::OnEvent(GameEventType event, CBaseEntity *pEntity, CBaseEntity *pOt { if (event == EVENT_PLAYER_DIED) { - if (BotRelationship(pPlayer) == BOT_TEAMMATE) + CBasePlayer *pVictim = pPlayer; + + if (BotRelationship(pVictim) == BOT_TEAMMATE) { CBasePlayer *pKiller = static_cast(pOther); // 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 // snipers stay put - if (!IsSniper() && IsVisible(&pPlayer->pev->origin)) + if (!IsSniper() && IsVisible(&pVictim->pev->origin)) { // people are dying - we should hurry Hurry(RANDOM_FLOAT(10.0f, 15.0f));