If LineOfSight check is enabled, no Nametags are shown anymore.
Description
Description
Details
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; }