XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: improve unlockAllScans's handling of existing scans (#1875)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1875 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

5cda2e2d
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +9 -1
Modified src/controllers/stats/viewController.ts +9 -1
@@ -27,7 +27,15 @@ const viewController: RequestHandler = async (req, res) => {
27 27 for (const type of Object.keys(ExportEnemies.avatars)) {
28 28 if (!scans.has(type)) scans.add(type);
29 29 }
30 responseJson.Scans ??= [];
30
31 // Take any existing scans and also set them to 9999
32 if (responseJson.Scans) {
33 for (const scan of responseJson.Scans) {
34 scans.add(scan.type);
35 }
36 }
37 responseJson.Scans = [];
38
31 39 for (const type of scans) {
32 40 responseJson.Scans.push({ type: type, scans: 9999 });
33 41 }