API: Return active SF levels in getOwnedSourceFiles and ResetInfo.ownedSF (#1761)

* DOCUMENTATION: Clarify getOwnedSourceFiles when player overrides active levels of SFs
* Return Player.activeSourceFiles instead of Player.sourceFiles
* Get rid of zeroes in the map
This commit is contained in:
catloversg
2024-11-11 13:56:57 +07:00
committed by GitHub
parent cb9e281c45
commit 72a63b15cb
6 changed files with 38 additions and 7 deletions
+5 -1
View File
@@ -1825,7 +1825,11 @@ export const ns: InternalAPI<NSFull> = {
lastNodeReset: Player.lastNodeReset,
currentNode: Player.bitNodeN,
ownedAugs: new Map(Player.augmentations.map((aug) => [aug.name, aug.level])),
ownedSF: new Map(Player.sourceFiles),
ownedSF: new Map(
[...Player.activeSourceFiles].filter(([__, activeLevel]) => {
return activeLevel > 0;
}),
),
bitNodeOptions: {
...Player.bitNodeOptions,
sourceFileOverrides: new Map(Player.bitNodeOptions.sourceFileOverrides),