Hide character names/health/etc. if you can't see their head or it doesn't exist.
TODO: use Line of Sight instead of CheckVisibility
This commit is contained in:
@@ -296,11 +296,18 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (this == controlled) return;
|
if (this == controlled) return;
|
||||||
|
|
||||||
|
//Ideally it shouldn't send the character entirely if we can't see them but /shrug, this isn't the most hacker-proof game atm
|
||||||
|
Limb selfHead = controlled != null ? controlled.AnimController.GetLimb(LimbType.Head) : null;
|
||||||
|
Limb targHead = this.AnimController.GetLimb(LimbType.Head);
|
||||||
|
if (controlled != null && selfHead != null && targHead != null && Submarine.CheckVisibility(selfHead.SimPosition, targHead.SimPosition) != null) //TODO: use Line of Sight instead of CheckVisibility
|
||||||
|
return;
|
||||||
|
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
string name = Info.DisplayName;
|
string name = Info.DisplayName;
|
||||||
if (controlled == null && name != Info.Name)
|
if (controlled == null && name != Info.Name)
|
||||||
name += " (Disguised)";
|
name += " (Disguised)";
|
||||||
|
|
||||||
Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(name) * 0.5f / cam.Zoom;
|
Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(name) * 0.5f / cam.Zoom;
|
||||||
Color nameColor = Color.White;
|
Color nameColor = Color.White;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user