Page MenuHomeFeedback Tracker

Nametag LOS check always fails
Awaiting internal Testing, NormalPublic

Description

If LineOfSight check is enabled, no Nametags are shown anymore.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce

Enable "Trace For LOS" in any Nametag config

Additional Information

The function SCR_NameTagRulesetBase::TraceLOS() has a bug. The TraceParam is set to exclude the player, but it does not exclude the target entity. Therefore, the linetrace ALWAYS fails. Locally, I fixed it by using ExcludeArray to specify both entities:

override protected bool TraceLOS(SCR_NameTagData data)
{
	TraceParam param = new TraceParam;
	param.Start = m_CurrentPlayerTag.m_vEntHeadPos;
	param.End = data.m_vEntHeadPos + HEAD_LOS_OFFSET;
	param.LayerMask = EPhysicsLayerDefs.Projectile;
	param.Flags = TraceFlags.ANY_CONTACT | TraceFlags.WORLD | TraceFlags.ENTS; 
	array<IEntity> excludes = { m_CurrentPlayerTag.m_Entity, data.m_Entity };
	param.ExcludeArray = excludes;
		
	float percent = GetGame().GetWorld().TraceMove(param, null);
	if (percent == 1)	// If trace travels the entire path, return true
		return true;
			
	return false;
}

Event Timeline

DasMaeh created this task.Dec 11 2023, 11:29 PM
DasMaeh edited Additional Information. (Show Details)
Geez changed the task status from New to Awaiting internal Testing.Jan 2 2024, 1:53 PM