fix: fill upgrades array with empty strings (#1023)
Otherwise the client will "LogBug: (Invalid UpgradeId)" and may crash/raise an interrupt Reviewed-on: OpenWF/SpaceNinjaServer#1023 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
parent
c13cf70814
commit
8fea608b76
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user