1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Count all owned points first so shield isn't dropped half way through the counting/capturing

This commit is contained in:
NG (Graham)
2025-12-11 20:59:44 -05:00
parent f36cc5b2b3
commit 29b5490f86

View File

@@ -334,7 +334,7 @@ impl PointTracker {
let mut owned_points = std::collections::HashMap::with_capacity(2); let mut owned_points = std::collections::HashMap::with_capacity(2);
let mut captured_firsts = std::collections::HashSet::new(); let mut captured_firsts = std::collections::HashSet::new();
let mut lost_lasts = std::collections::HashSet::new(); let mut lost_lasts = std::collections::HashSet::new();
for (i, cap_point) in self.points.iter().enumerate() { for cap_point in self.points.iter() {
let point_owner = cap_point.team.load(std::sync::atomic::Ordering::SeqCst); let point_owner = cap_point.team.load(std::sync::atomic::Ordering::SeqCst);
if point_owner >= 0 { if point_owner >= 0 {
let point_owner = point_owner as u8; let point_owner = point_owner as u8;
@@ -344,6 +344,9 @@ impl PointTracker {
owned_points.insert(point_owner, 1); owned_points.insert(point_owner, 1);
} }
} }
}
for (i, cap_point) in self.points.iter().enumerate() {
let point_owner = cap_point.team.load(std::sync::atomic::Ordering::SeqCst);
let friendlies = cap_point.owners_on_point().await; let friendlies = cap_point.owners_on_point().await;
let enemies = cap_point.stealers_on_point().await; let enemies = cap_point.stealers_on_point().await;
if friendlies != 0 { continue; } if friendlies != 0 { continue; }