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
8 changes: 7 additions & 1 deletion src/game/server/tf/tf_obj_teleporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,11 @@ void CObjectTeleporter::OnGoActive( void )
UpdateMaxHealth( pMatch->GetMaxHealth() );
}
}

if ( TFGameRules()->IsMannVsMachineMode() && GetTeamNumber() == TF_TEAM_PVE_INVADERS )
{
EmitSound( "mvm/mvm_tele_activate.wav" );
}
Comment on lines +447 to +451

@FlaminSarge FlaminSarge Jun 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of here, this logic should live in C_TFBotHintEngineerNest::StartEffect in src\game\client\tf\bot_npc\map_entities\c_tf_bot_hint_engineer_nest.cpp alongside the particle effect logic, or in its serverside code CTFBotHintEngineerNest::HintTeleporterThink in src\game\server\tf\bot\map_entities\tf_bot_hint_engineer_nest.cpp.

There's already examples of EmitSound being called on hint entities like this, e.g. CTFBotMvMEngineerTeleportSpawn::Update calls EmitSound on its hint entity. However, if you want the noise to be global, you can use TFGameRules()->BroadcastSound (which that class also does).

(You could probably get away with emitting it on the clientside object, honestly).

}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -482,6 +487,7 @@ void CObjectTeleporter::Precache()
PrecacheScriptSound( "Building_Teleporter.SpinLevel1" );
PrecacheScriptSound( "Building_Teleporter.SpinLevel2" );
PrecacheScriptSound( "Building_Teleporter.SpinLevel3" );
PrecacheSound("mvm/mvm_tele_activate.wav");

@FlaminSarge FlaminSarge Jun 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should most likely be a script sound like the other sounds, and set up in game_sounds_mvm.txt. You can request for changes to those files in the PR description, and set up the code as if those files were updated.

Also this precache should probably happen alongside the other MVM sounds.


PrecacheParticleSystem( "teleporter_red_charged" );
PrecacheParticleSystem( "teleporter_blue_charged" );
Expand Down Expand Up @@ -1537,4 +1543,4 @@ void CObjectTeleporter::FireGameEvent( IGameEvent *event )
SetTeleportingPlayer( NULL );
}
}
}
}