Fixed possible crash
This commit is contained in:
parent
3291b701d5
commit
db03935f34
1 changed files with 20 additions and 2 deletions
|
@ -1942,7 +1942,16 @@ private:
|
||||||
//--------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------
|
||||||
void CCSBotManager::OnBreakBreakable( IGameEvent *event )
|
void CCSBotManager::OnBreakBreakable( IGameEvent *event )
|
||||||
{
|
{
|
||||||
CheckAreasOverlappingBreakable collector( UTIL_EntityByIndex( event->GetInt( "entindex" ) ) );
|
auto ent = UTIL_EntityByIndex( event->GetInt( "entindex" ) );
|
||||||
|
|
||||||
|
if ( !ent )
|
||||||
|
{
|
||||||
|
// TODO_ENHANCED.
|
||||||
|
DevMsg("CCSBotManager::OnBreakBreakable bug\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckAreasOverlappingBreakable collector( ent );
|
||||||
TheNavMesh->ForAllAreas( collector );
|
TheNavMesh->ForAllAreas( collector );
|
||||||
|
|
||||||
CCSBOTMANAGER_ITERATE_BOTS( OnBreakBreakable, event );
|
CCSBOTMANAGER_ITERATE_BOTS( OnBreakBreakable, event );
|
||||||
|
@ -1952,7 +1961,16 @@ void CCSBotManager::OnBreakBreakable( IGameEvent *event )
|
||||||
//--------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------
|
||||||
void CCSBotManager::OnBreakProp( IGameEvent *event )
|
void CCSBotManager::OnBreakProp( IGameEvent *event )
|
||||||
{
|
{
|
||||||
CheckAreasOverlappingBreakable collector( UTIL_EntityByIndex( event->GetInt( "entindex" ) ) );
|
auto ent = UTIL_EntityByIndex( event->GetInt( "entindex" ) );
|
||||||
|
|
||||||
|
if ( !ent )
|
||||||
|
{
|
||||||
|
// TODO_ENHANCED.
|
||||||
|
DevMsg("CCSBotManager::OnBreakProp bug\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckAreasOverlappingBreakable collector( ent );
|
||||||
TheNavMesh->ForAllAreas( collector );
|
TheNavMesh->ForAllAreas( collector );
|
||||||
|
|
||||||
CCSBOTMANAGER_ITERATE_BOTS( OnBreakProp, event );
|
CCSBOTMANAGER_ITERATE_BOTS( OnBreakProp, event );
|
||||||
|
|
Loading…
Reference in a new issue