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

fix(webui): use optional chaining operator for `maxLevelCap` (#2904)

For items that not in itemMap Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2904 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

fb4c4249
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

1 个文件 +2 -2
Modified static/webui/script.js +2 -2
@@ -832,7 +832,7 @@ function updateInventory() {
832 832 const td = document.createElement("td");
833 833 td.classList = "text-end text-nowrap";
834 834
835 let maxXP = Math.pow(itemMap[item.ItemType].maxLevelCap ?? 30, 2) * 1000;
835 let maxXP = Math.pow(itemMap[item.ItemType]?.maxLevelCap ?? 30, 2) * 1000;
836 836 if (
837 837 category != "Suits" &&
838 838 category != "SpaceSuits" &&
@@ -859,7 +859,7 @@ function updateInventory() {
859 859 }
860 860 }
861 861 if (
862 itemMap[item.ItemType].maxLevelCap > 30 &&
862 itemMap[item.ItemType]?.maxLevelCap > 30 &&
863 863 (item.Polarized ?? 0) < (itemMap[item.ItemType].maxLevelCap - 30) / 2
864 864 ) {
865 865 const a = document.createElement("a");