u/Maleficent_Risk_3159

How does this function work?

I have this thing that needs to check if the player already has this weapon in the Deploy(); function, and if the player does have the weapon (e.g. AK-47) then it doesn't do anything but otherwise it's supposed to do something. The function I'm referring to is pPlayer->GetWeapon(); .

The code block:

bool CBaseHLCombatWeapon::Deploy( void )
{
// If we should be lowered, deploy in the lowered position
// We have to ask the player if the last time it checked, the weapon was lowered
if ( GetOwner() && GetOwner()->IsPlayer() )
{
CHL2_Player *pPlayer = assert_cast<CHL2_Player*>( GetOwner() );
//if (pPlayer->GetWeapon() <--- right here ) {
//here be something
//}
if ( pPlayer->IsWeaponLowered() )
{
if ( SelectWeightedSequence( ACT_VM_IDLE_LOWERED ) != ACTIVITY_NOT_AVAILABLE )
{
if ( DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_VM_IDLE_LOWERED, (char*)GetAnimPrefix() ) )
{
m_bLowered = true;

// Stomp the next attack time to fix the fact that the lower idles are long
pPlayer->SetNextAttack( gpGlobals->curtime + 1.0 );
m_flNextPrimaryAttack = gpGlobals->curtime + 1.0;
m_flNextSecondaryAttack= gpGlobals->curtime + 1.0;
return true;
}
}
}
}

m_bLowered = false;
return BaseClass::Deploy();
}

Thank you for your help!

reddit.com
u/Maleficent_Risk_3159 — 16 hours ago

Why aren't my materials showing up?

I have this viewmodel that is basically a recreation of the v_hands viewmodel. The diagram shows the differences between Blender and HLMV/HLMV++/in-game and my frustration about this problem. I checked the materials and the .qc file but it's still a load of garbage. Thank you for helping me!

u/Maleficent_Risk_3159 — 2 days ago

Game crashes for no reason.

I'm making a mod similar to TFR in the 1980's, but I've hit a big roadblock: the game won't go past the "Initializing Game" text and crashes constantly in the same place at different times. If you'd like to help me, you can read the error log. Thank you for your continued service!

reddit.com
u/Maleficent_Risk_3159 — 14 days ago