Don't strip all digits from air support's callsign

This commit is contained in:
Raffson 2023-01-29 18:18:29 +01:00
parent bb0bf66eac
commit b7d95819c1
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 11 additions and 5 deletions

View File

@ -15,7 +15,7 @@ def callsign_for_support_unit(group: FlyingGroup[Any]) -> str:
try: try:
return f"Flight {int(raw_callsign)}" return f"Flight {int(raw_callsign)}"
except ValueError: except ValueError:
return raw_callsign.rstrip("1234567890") return f"{raw_callsign[:-2]} {raw_callsign[-2]}"
def create_group_callsign_from_unit(lead: FlyingUnit) -> str: def create_group_callsign_from_unit(lead: FlyingUnit) -> str:

View File

@ -72,11 +72,17 @@ class RaceTrackBuilder(PydcsWaypointBuilder):
tanker_info = self.mission_data.tankers[-1] tanker_info = self.mission_data.tankers[-1]
tacan = tanker_info.tacan tacan = tanker_info.tacan
if self.flight.tcn_name is None: if self.flight.tcn_name is None:
cs = tanker_info.callsign[:-2]
csn = tanker_info.callsign[-2]
tacan_callsign = { tacan_callsign = {
"Texaco": "TEX", "Texaco": "TX",
"Arco": "ARC", "Arco": "AC",
"Shell": "SHL", "Shell": "SH",
}.get(tanker_info.callsign) }.get(cs)
if tacan_callsign:
tacan_callsign = tacan_callsign + csn
else:
tacan_callsign = cs[0:2] + csn
else: else:
tacan_callsign = self.flight.tcn_name tacan_callsign = self.flight.tcn_name