Skip to content

Commit

Permalink
Fix a crash when func_breakable signals it for CCSBot::OnEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jul 3, 2020
1 parent 0cd233d commit cbfe8a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions regamedll/dlls/bot/cs_bot_event.cpp
Expand Up @@ -266,8 +266,17 @@ void CCSBot::OnEvent(GameEventType event, CBaseEntity *pEntity, CBaseEntity *pOt
break;
}
default:
{
#ifdef REGAMEDLL_FIXES
// Make sure that the entity is a player,
// because here the entity can come as CBreakable with event EVENT_BREAK_METAL
if (pPlayer && !pPlayer->IsPlayer())
return;
#endif

break;
}
}

// Process radio events from our team
if (pPlayer && BotRelationship(pPlayer) == BOT_TEAMMATE && event > EVENT_START_RADIO_1 && event < EVENT_END_RADIO)
Expand Down

0 comments on commit cbfe8a1

Please sign in to comment.