Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/game/shared/tf/tf_weapon_buff_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,24 @@ void CTFBuffItem::CreateBanner()
if ( !pPlayer || !pPlayer->IsAlive() )
return;

int iBuffType = GetBuffType();
// Prevent Crashes From Invalid Buff Types
if ( iBuffType > ARRAYSIZE(BannerModels) || iBuffType <= 0 )
{
DevMsg("Invalid buff type %d, Not Creating Banner\n", iBuffType);
return;
}

C_TFBuffBanner* pBanner = new C_TFBuffBanner;
if ( !pBanner )
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace

Suggested change

//Assert( iBuffType > 0 );
//Assert( iBuffType <= ARRAYSIZE(BannerModels) );
pBanner->m_nSkin = 0;
pBanner->InitializeAsClientEntity( BannerModels[GetBuffType()-1], RENDER_GROUP_OPAQUE_ENTITY );
pBanner->InitializeAsClientEntity( BannerModels[iBuffType-1], RENDER_GROUP_OPAQUE_ENTITY );
pBanner->SetBuffItem( this );
pBanner->SetBuffType( GetBuffType() );
pBanner->SetBuffType( iBuffType );
pBanner->ForceClientSideAnimationOn();
SetBanner( pBanner );
int iSpine = pPlayer->LookupBone( "bip_spine_3" );
Expand Down