tracked see each other

This commit is contained in:
catvayor 2024-09-06 12:13:23 +02:00
parent 57f64ad046
commit ecd879f32f
Signed by: lbailly
GPG key ID: CE3E645251AC63F3

View file

@ -61,17 +61,6 @@ impl TrackedState {
Vieux { .. } => false, Vieux { .. } => false,
} }
} }
pub fn global_viewed(&self) -> bool {
match self {
Conscrit {
captured,
mallette,
invisible,
..
} => (*captured || *mallette) && !*invisible,
Vieux { invisible, .. } => !*invisible,
}
}
pub fn color(&self) -> u8 { pub fn color(&self) -> u8 {
match self { match self {
Vieux { color, .. } => *color, Vieux { color, .. } => *color,
@ -230,7 +219,7 @@ pub fn apparent_info(
if watcher.id == team.id { if watcher.id == team.id {
None None
} else if let Conscrit { } else if let Conscrit {
captured, mallette, .. captured, ..
} = watcher.state } = watcher.state
{ {
if captured { if captured {
@ -250,11 +239,7 @@ pub fn apparent_info(
Some(base_view(team)) Some(base_view(team))
} }
} else { } else {
if mallette || team.state.global_viewed() {
Some(base_view(team)) Some(base_view(team))
} else {
None
}
} }
} else { } else {
Some(admin_view(team).into()) Some(admin_view(team).into())