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