Skip to content

Commit

Permalink
Improve Exploration data logic
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Apr 18, 2023
1 parent a1745a8 commit 5c2d7d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export default function NavigationInspectorPanel ({ systemObject, setSystemObjec
<h4 className='text-primary'>Exploration</h4>

{systemObject.hasOwnProperty('mapped') && <>
{systemObject.mapped
{systemObject.mapped === true
? <p className='text-info text-muted'><i className='icarus-terminal-scan' style={{position: 'relative', top: '.3rem', fontSize: '1.5rem'}}/> Surface scanned</p>
: <p className='text-info'><i className='icarus-terminal-scan' style={{position: 'relative', top: '.3rem', fontSize: '1.5rem'}}/> Surface not scanned</p>}
: <p className='text-info'><i className='icarus-terminal-scan' style={{position: 'relative', top: '.3rem', fontSize: '1.5rem'}}/> Surface scan required</p>}
</>}
{isLandable ? <p className='text-info'><i className='icarus-terminal-planet-lander' style={{position: 'relative', top: '.3rem', fontSize: '1.5rem'}}/> Landable surface</p> : null}

Expand Down
7 changes: 6 additions & 1 deletion src/service/lib/event-handlers/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,14 @@ class System {
// FIXME Suspect this logic isn't entirely correct
const inhabitedSystem = (system?.population > 0 || system?.stations?.length > 0 || system?.ports?.length > 0 || system?.megaships?.length > 0 || system?.settlements?.length > 0)
if (!inhabitedSystem) {
const Scan = await this.eliteLog._query({ event: 'Scan', BodyName: body.name, ScanType: 'Detailed' }, 1)
const Scan = await this.eliteLog._query({ event: 'Scan', BodyName: body.name }, 1)
body.discovered = Scan[0]?.WasDiscovered ?? false
body.mapped = Scan[0]?.WasMapped ?? false

// If there is an SAAScanComplete entry for the body, it has been scanned
// (even if the Scan entry says it has not, because it's old data)
const SAAScanComplete = await this.eliteLog._query({ event: 'SAAScanComplete', BodyName: body.name }, 1)
if (SAAScanComplete[0]?.BodyName) body.mapped = true
}
}
}
Expand Down

0 comments on commit 5c2d7d1

Please sign in to comment.