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: 12 additions & 2 deletions src/game/server/tf/player_vs_environment/tf_point_weapon_mimic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class CTFPointWeaponMimic : public CPointEntity
CTFPointWeaponMimic();
~CTFPointWeaponMimic();
virtual void Spawn();
virtual void Precache();

void InputFireOnce( inputdata_t& inputdata );
void InputFireMultiple( inputdata_t& inputdata );
Expand Down Expand Up @@ -99,13 +100,21 @@ CTFPointWeaponMimic::~CTFPointWeaponMimic()
void CTFPointWeaponMimic::Spawn()
{
BaseClass::Spawn();
Precache();
Copy link
Contributor

Choose a reason for hiding this comment

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

Precache is called by the game, you don't call it yourself

Copy link
Author

@WereTech WereTech Nov 7, 2025

Choose a reason for hiding this comment

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

It doesn't seem to precache without the explicit call in Spawn, as removing the call will now produce "<sound> not precached" and not play.

ChangeTeam( TF_TEAM_BLUE );
}

void CTFPointWeaponMimic::Precache()
{
if( m_pzsFireSound )
{
PrecacheScriptSound( m_pzsFireSound );
}

if( m_pzsModelOverride )
{
PrecacheModel( m_pzsModelOverride );
}

ChangeTeam( TF_TEAM_BLUE );
}


Expand Down Expand Up @@ -149,6 +158,7 @@ void CTFPointWeaponMimic::Fire()
{
Assert( m_nWeaponType >= 0 && m_nWeaponType < WEAPON_TYPES );

EmitSound( m_pzsFireSound );
switch( m_nWeaponType )
{
case WEAPON_STANDARD_ROCKET:
Expand Down