Skip to content

Commit 08131a4

Browse files
committed
do not merge contacts which have invalid coordinates
1 parent 67a8b9e commit 08131a4

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/controller/merged.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ func (c *controller) updateMergesForContact(hostile, friendly *trackfiles.Trackf
175175
Logger()
176176

177177
isMerged := c.merges.isMerged(hostile.Contact.ID, friendly.Contact.ID)
178+
if friendly.IsLastKnownPointZero() || hostile.IsLastKnownPointZero() {
179+
c.merges.separate(hostile.Contact.ID, friendly.Contact.ID)
180+
return false
181+
}
178182
distance := spatial.Distance(friendly.LastKnown().Point, hostile.LastKnown().Point)
179183
enteredMerge := distance < brevity.MergeEntryDistance
180184
exitedMerge := distance > brevity.MergeExitDistance

pkg/radar/merged.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ func (s *scope) Merges(coalition coalitions.Coalition) map[brevity.Group][]*trac
2525
continue
2626
}
2727

28+
if contact.IsLastKnownPointZero() {
29+
continue
30+
}
31+
2832
// Exclude hostile helicopters
2933
if data, ok := encyclopedia.GetAircraftData(contact.Contact.ACMIName); ok && data.Category() == brevity.RotaryWing {
3034
continue

0 commit comments

Comments
 (0)