UTIL ValidateSoundName

From Valve Developer Community
Revision as of 18:08, 30 July 2021 by GamerDude27 (talk | contribs) (Cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This UTIL function allocates a string to a set value if said string is a null string or simply "0". It is typically used for keeping sound names valid, as the name suggests.


void UTIL_ValidateSoundName( string_t &name, const char *defaultStr )


    // If the hit sound string is not set, then play the generic hit sound.
    UTIL_ValidateSoundName( m_WeaponHit, "Generic.WeaponHit" );
    EmitSound( m_WeaponHit );