fix: fill upgrades array with empty strings
All checks were successful
Build / build (22) (push) Successful in 34s
Build / build (18) (pull_request) Successful in 35s
Build / build (22) (pull_request) Successful in 1m10s
Build / build (20) (push) Successful in 1m1s
Build / build (18) (push) Successful in 1m11s
Build / build (20) (pull_request) Successful in 1m2s

Otherwise the client will "LogBug: (Invalid UpgradeId)" and may crash/raise an interrupt
This commit is contained in:
Sainan 2025-02-25 23:57:36 +01:00
parent a27f1c5e01
commit 3baf259289

View File

@ -544,6 +544,9 @@ export const applyDefaultUpgrades = (
for (const defaultUpgrade of defaultUpgrades) {
modsToGive.push({ ItemType: defaultUpgrade.ItemType, ItemCount: 1 });
if (defaultUpgrade.Slot != -1) {
while (upgrades.length < defaultUpgrade.Slot) {
upgrades.push("");
}
upgrades[defaultUpgrade.Slot] = defaultUpgrade.ItemType;
}
}