forked from OpenWF/SpaceNinjaServer
chore: improve unlockAllScans's handling of existing scans (#1875)
Reviewed-on: OpenWF/SpaceNinjaServer#1875 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
e23d865044
commit
5cda2e2d08
@ -27,7 +27,15 @@ const viewController: RequestHandler = async (req, res) => {
|
|||||||
for (const type of Object.keys(ExportEnemies.avatars)) {
|
for (const type of Object.keys(ExportEnemies.avatars)) {
|
||||||
if (!scans.has(type)) scans.add(type);
|
if (!scans.has(type)) scans.add(type);
|
||||||
}
|
}
|
||||||
responseJson.Scans ??= [];
|
|
||||||
|
// Take any existing scans and also set them to 9999
|
||||||
|
if (responseJson.Scans) {
|
||||||
|
for (const scan of responseJson.Scans) {
|
||||||
|
scans.add(scan.type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
responseJson.Scans = [];
|
||||||
|
|
||||||
for (const type of scans) {
|
for (const type of scans) {
|
||||||
responseJson.Scans.push({ type: type, scans: 9999 });
|
responseJson.Scans.push({ type: type, scans: 9999 });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user