From 0cdcb73a0133fe1cb52db889ceebbcc89831438b Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 17 Jan 2022 07:42:26 -0600 Subject: [PATCH] Use LOS check for nametags --- scripts/client/nametag.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/client/nametag.js b/scripts/client/nametag.js index 15c212c6..7009f884 100644 --- a/scripts/client/nametag.js +++ b/scripts/client/nametag.js @@ -165,6 +165,13 @@ function updateNametags(element) { let distance = playerPos.distance(elementPos); if(distance <= nametagDistance) { + if(typeof game.processLineOfSight != "undefined") { + let losCheck = game.processLineOfSight(playerPos, elementPos, true, false, false, true, true, false, true, true); + if(losCheck != null) { + return false; + } + } + if(element.type == ELEMENT_PLAYER) { let name = element.name; let colour = COLOUR_WHITE;