PDA

View Full Version : Suit power help


steveo3861
06-11-2007, 07:38 AM
How can I make the sprint bar stay on and not disappear after its done charging? I'm sure its in hud_suitpower.cpp but no matter what I change I can't seem to make it stay on. :confused:
Any help is greatly appreciated.

softboysxp
06-11-2007, 08:42 AM
in hud_suitpower.cpp, find this line :
bool sprintActive = pPlayer->IsSprinting();
change it to :
bool sprintActive = true;

and change
if (pPlayer->IsSprinting())
to
if (true)

steveo3861
06-11-2007, 08:49 AM
Thank you for your help and such a quick reply ;)

The suit power bar is on when I first join a server but disappears after I sprint. I believe it has something todo with:


bool CHudSuitPower::ShouldDraw()
{

bool bNeedsDraw = true;

C_BaseHLPlayer *pPlayer = (C_BaseHLPlayer *)C_BasePlayer::GetLocalPlayer();
if ( !pPlayer )
return false;

// needs draw if suit power changed or animation in progress
bNeedsDraw = ( ( pPlayer->m_HL2Local.m_flSuitPower != m_flSuitPower ) || ( m_AuxPowerColor[3] > 0 ) );


return ( bNeedsDraw && CHudElement::ShouldDraw() );

}

Marine
06-11-2007, 10:18 AM
Simply comment out the contents of that function and
return true;

Its that simple :)

steveo3861
06-11-2007, 10:27 AM
Simply comment out the contents of that function and
return true;

Its that simple :)

I wish it was that simple... That was the first thing I tried without no luck. It still disappears after I first sprint. Thanks for your help though

softboysxp
06-11-2007, 10:50 AM
in CHudSuitPower::CHudSuitPower(...), change this line :
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD | HIDEHUD_NEEDSUIT );
to
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );