mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Fix crash on point capture caused by counting fix, fix #66
This commit is contained in:
@@ -372,9 +372,15 @@ impl PointTracker {
|
||||
lost_lasts.insert(point_owner as u8);
|
||||
}
|
||||
// in case 2+ points are captured in the same tick
|
||||
*owned_points.get_mut(&(new_team as u8)).unwrap() += 1;
|
||||
if let Some(new_team_owned_points) = owned_points.get_mut(&(new_team as u8)) {
|
||||
*new_team_owned_points += 1;
|
||||
} else {
|
||||
owned_points.insert(new_team as u8, 1);
|
||||
}
|
||||
if point_owner >= 0 {
|
||||
*owned_points.get_mut(&(point_owner as u8)).unwrap() -= 1;
|
||||
if let Some(old_owner_owned_points) = owned_points.get_mut(&(point_owner as u8)) {
|
||||
*old_owner_owned_points -= 1;
|
||||
}
|
||||
}
|
||||
generic.broadcast(
|
||||
rlnl::event_code::NetworkEvent::CapturePointNotification,
|
||||
|
||||
Reference in New Issue
Block a user