Skip to content

[TF2] Medic heal target indicator disappears when using Ubercharge #7747

@Squid-Eevee

Description

@Squid-Eevee

While hud_medichealtargetmarker is set to 1, the game uses a separate particle system for the medibeam that adds an indicator over your current patient's head to make it more clear who you're currently healing. But the game only does this check when you aren't using an Ubercharge, instead defaulting to the standard Ubercharge particle system for your respective team.
This is the entire check done in tf_weapon_medigun.cpp (with added comments)

if ( IsAttachedToBuilding() ) //if healing a building
{
	pszEffectName = "medicgun_beam_machinery"; //use machinery particle system (this never happens)
}
else if ( pFiringPlayer->GetTeamNumber() == TF_TEAM_RED ) //if not healing a building, then if the player is on the red team
{
	if ( m_bChargeRelease ) //if using ubercharge
	{
		pszEffectName = "medicgun_beam_red_invun"; //use red uber particle system
	}
	else //if not using ubercharge
	{
		if ( bHealTargetMarker && pFiringPlayer == pLocalPlayer ) //if player has target marker setting enabled and is the local player
		{
			pszEffectName = "medicgun_beam_red_targeted"; //use red particle system with marker
		}
		else //if not
		{
			pszEffectName = "medicgun_beam_red"; //use ordinary red particle system
		}
	}
}
else //if player is not on the red team
{
	if ( m_bChargeRelease ) //all the same checks as above, but for the blue particle systems instead
	{
		pszEffectName = "medicgun_beam_blue_invun";
	}
	else
	{
		if ( bHealTargetMarker && pFiringPlayer == pLocalPlayer )
		{
			pszEffectName = "medicgun_beam_blue_targeted";
		}
		else
		{
			pszEffectName = "medicgun_beam_blue";
		}
	}
}

This results in the marker disappearing when an Ubercharge is deployed:
POV of a Red Medic healing another Red Medic. There are bright green cuboids around the particle systems used in the screenshot, and the Medic being healed has a red triangular marker over his head.
The same image but the POV has deployed an Ubercharge. The marker has disappeared from above the other Medic's head.

The fix for this would be to add those same checks to the if(m_bChargeRelease) branches and create new particle systems in medicgun_beam.pcf (and medicgun_beam_dx80.pcf) that include the target marker particle.
A screenshot of the Source engine particle system editor. Currently the file medicgun_beam.pcf is open. Two new particle systems have been added: `medicgun_beam_blue_invun_targeted` and `medicgun_beam_red_invun_targeted`

if ( IsAttachedToBuilding() )
{
	pszEffectName = "medicgun_beam_machinery";
}
else if ( pFiringPlayer->GetTeamNumber() == TF_TEAM_RED )
{
	if ( m_bChargeRelease )
	{
		if ( bHealTargetMarker && pFiringPlayer == pLocalPlayer )
		{
			pszEffectName = "medicgun_beam_red_invun_targeted";
		}
		else
		{
			pszEffectName = "medicgun_beam_red_invun";
		}
	}
	else
	{
		if ( bHealTargetMarker && pFiringPlayer == pLocalPlayer )
		{
			pszEffectName = "medicgun_beam_red_targeted";
		}
		else
		{
			pszEffectName = "medicgun_beam_red";
		}
	}
}
else
{
	if ( m_bChargeRelease )
	{
		if ( bHealTargetMarker && pFiringPlayer == pLocalPlayer )
		{
			pszEffectName = "medicgun_beam_blue_invun_targeted";
		}
		else
		{
			pszEffectName = "medicgun_beam_blue_invun";
		}
	}
	else
	{
		if ( bHealTargetMarker && pFiringPlayer == pLocalPlayer )
		{
			pszEffectName = "medicgun_beam_blue_targeted";
		}
		else
		{
			pszEffectName = "medicgun_beam_blue";
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions