@@ -180,9 +180,27 @@ class CmdrStatus {
180
180
181
181
if ( cmdrStatus ?. flags ?. docked && cmdrStatus ?. flags ?. onFoot === false ) {
182
182
// If docked and not on foot get the last Embark/Docked event to find out what station we are on
183
- if ( ! dockedEvent && embarkEvent ?. StationName ) location . push ( embarkEvent . StationName )
184
- if ( ! embarkEvent && dockedEvent ?. StationName ) location . push ( dockedEvent . StationName )
185
- if ( ! embarkEvent && ! dockedEvent && touchdownEvent ?. NearestDestination ) location . push ( touchdownEvent . NearestDestination )
183
+
184
+ // FIXME: This is technically incorrect and it should use whatever is the
185
+ // most recent event
186
+ if ( ! dockedEvent && embarkEvent ?. StationName ) {
187
+ location . push ( embarkEvent . StationName )
188
+ } else if ( ! embarkEvent && dockedEvent ?. StationName ) {
189
+ if ( dockedEvent ?. StationType === 'FleetCarrier' ) {
190
+ location . push ( `Carrier ${ dockedEvent . StationName } ` )
191
+ } else {
192
+ location . push ( dockedEvent . StationName )
193
+ }
194
+ } else if ( ! embarkEvent && ! dockedEvent && touchdownEvent ?. NearestDestination ) {
195
+ location . push ( touchdownEvent . NearestDestination )
196
+ } else if ( locationEvent ?. StationName ) {
197
+ if ( locationEvent ?. StationType === 'FleetCarrier' ) {
198
+ location . push ( `Carrier ${ locationEvent . StationName } ` )
199
+ } else {
200
+ location . push ( locationEvent . StationName )
201
+ }
202
+ if ( locationEvent ?. Docked === true ) location . push ( 'Docked' )
203
+ }
186
204
187
205
if ( dockedEvent && embarkEvent ) {
188
206
if ( touchdownEvent &&
@@ -194,7 +212,11 @@ class CmdrStatus {
194
212
// If we have both a Docked event and an Embark event with a station
195
213
// name, use the newest value
196
214
if ( Date . parse ( dockedEvent ?. timestamp ) > Date . parse ( embarkEvent ?. timestamp ) ) {
197
- location . push ( dockedEvent . StationName )
215
+ if ( dockedEvent ?. StationType === 'FleetCarrier' ) {
216
+ location . push ( `Carrier ${ dockedEvent . StationName } ` )
217
+ } else {
218
+ location . push ( dockedEvent . StationName )
219
+ }
198
220
} else {
199
221
location . push ( embarkEvent . StationName )
200
222
}
@@ -206,7 +228,11 @@ class CmdrStatus {
206
228
// FIXME As a simple sanity check, we at least verify the event was
207
229
// triggered in the same system (crude, but hopefully good enough).
208
230
if ( dockedEvent ?. StarSystem === currentSystem ?. name ) {
209
- location . push ( dockedEvent . StationName )
231
+ if ( dockedEvent ?. StationType === 'FleetCarrier' ) {
232
+ location . push ( `Carrier ${ dockedEvent . StationName } ` )
233
+ } else {
234
+ location . push ( dockedEvent . StationName )
235
+ }
210
236
location . push ( 'Docked' )
211
237
}
212
238
}
0 commit comments