Skip to content

Commit 2a3a814

Browse files
committed
1 parent f5177cb commit 2a3a814

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/game/shared/tf/tf_weapon_buff_item.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,34 @@ void CTFBuffItem::CreateBanner()
316316
if ( !pPlayer || !pPlayer->IsAlive() )
317317
return;
318318

319+
#ifdef BDSBASE
320+
int iBuffType = GetBuffType();
321+
// Prevent Crashes From Invalid Buff Types
322+
if (iBuffType > ARRAYSIZE(BannerModels) || iBuffType <= 0)
323+
{
324+
DevMsg("Invalid buff type %d, Not Creating Banner\n", iBuffType);
325+
return;
326+
}
327+
#endif
328+
319329
C_TFBuffBanner* pBanner = new C_TFBuffBanner;
320330
if ( !pBanner )
321331
return;
322332

323333
//Assert( iBuffType > 0 );
324334
//Assert( iBuffType <= ARRAYSIZE(BannerModels) );
325335
pBanner->m_nSkin = 0;
336+
#ifdef BDSBASE
337+
pBanner->InitializeAsClientEntity(BannerModels[iBuffType - 1], RENDER_GROUP_OPAQUE_ENTITY);
338+
#else
326339
pBanner->InitializeAsClientEntity( BannerModels[GetBuffType()-1], RENDER_GROUP_OPAQUE_ENTITY );
340+
#endif
327341
pBanner->SetBuffItem( this );
342+
#ifdef BDSBASE
343+
pBanner->SetBuffType(iBuffType);
344+
#else
328345
pBanner->SetBuffType( GetBuffType() );
346+
#endif
329347
pBanner->ForceClientSideAnimationOn();
330348
SetBanner( pBanner );
331349
int iSpine = pPlayer->LookupBone( "bip_spine_3" );

0 commit comments

Comments
 (0)