From 86e758c0576d5f5648b0283825421ae42fd4a56a Mon Sep 17 00:00:00 2001 From: catvayor Date: Sun, 8 Sep 2024 15:06:45 +0200 Subject: [PATCH] tracker don't see npcs --- src/global.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/global.rs b/src/global.rs index 28e1106..64a8a4f 100644 --- a/src/global.rs +++ b/src/global.rs @@ -73,6 +73,12 @@ impl TrackedState { } } } + pub fn npc(&self) -> bool { + match self { + Vieux { color, .. } => *color != 1, + Conscrit { .. } => false, + } + } pub fn admin_color(&self) -> u8 { match self { Vieux { color, invisible } => { @@ -218,12 +224,9 @@ pub fn apparent_info( ) -> Option { if watcher.id == team.id { None - } else if let Conscrit { - captured, .. - } = watcher.state - { + } else if let Conscrit { captured, .. } = watcher.state { if captured { - if team.state.invisible() { + if team.state.invisible() || team.state.npc() { None } else if team.state.blurred() { let mut rng = rand::thread_rng();