forked from OpenWF/SpaceNinjaServer
fix: handle acquisition of modular weapon parts (#906)
Fixes #905 Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/906
This commit is contained in:
parent
1351e73961
commit
d396fe8b5c
@ -322,7 +322,6 @@ export const addItem = async (
|
|||||||
}
|
}
|
||||||
if (typeName in ExportWeapons) {
|
if (typeName in ExportWeapons) {
|
||||||
const weapon = ExportWeapons[typeName];
|
const weapon = ExportWeapons[typeName];
|
||||||
// Many non-weapon items are "Pistols" in Public Export, so some duck typing is needed.
|
|
||||||
if (weapon.totalDamage != 0) {
|
if (weapon.totalDamage != 0) {
|
||||||
const inventoryChanges = addEquipment(inventory, weapon.productCategory, typeName);
|
const inventoryChanges = addEquipment(inventory, weapon.productCategory, typeName);
|
||||||
updateSlots(inventory, InventorySlot.WEAPONS, 0, 1);
|
updateSlots(inventory, InventorySlot.WEAPONS, 0, 1);
|
||||||
@ -332,6 +331,20 @@ export const addItem = async (
|
|||||||
WeaponBin: { count: 1, platinum: 0, Slots: -1 }
|
WeaponBin: { count: 1, platinum: 0, Slots: -1 }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
// Modular weapon parts
|
||||||
|
const miscItemChanges = [
|
||||||
|
{
|
||||||
|
ItemType: typeName,
|
||||||
|
ItemCount: quantity
|
||||||
|
} satisfies IMiscItem
|
||||||
|
];
|
||||||
|
addMiscItems(inventory, miscItemChanges);
|
||||||
|
return {
|
||||||
|
InventoryChanges: {
|
||||||
|
MiscItems: miscItemChanges
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeName in creditBundles) {
|
if (typeName in creditBundles) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user