remove needless intermediate variable for ItemType
All checks were successful
Build / build (push) Successful in 1m28s
Build / build (pull_request) Successful in 1m23s

This commit is contained in:
Sainan 2025-04-16 20:54:27 +02:00
parent 7a4f344bcf
commit a5bca9fa8e

View File

@ -177,8 +177,7 @@ export const sellController: RequestHandler = async (req, res) => {
const index = inventory.CrewShipWeapons.findIndex(x => x._id.equals(sellItem.String));
if (index != -1) {
if (payload.SellCurrency == "SC_Resources") {
const itemType = inventory.CrewShipWeapons[index].ItemType;
refundPartialBuildCosts(inventory, itemType, inventoryChanges);
refundPartialBuildCosts(inventory, inventory.CrewShipWeapons[index].ItemType, inventoryChanges);
}
inventory.CrewShipWeapons.splice(index, 1);
freeUpSlot(inventory, InventorySlot.RJ_COMPONENT_AND_ARMAMENTS);
@ -201,8 +200,11 @@ export const sellController: RequestHandler = async (req, res) => {
const index = inventory.CrewShipWeaponSkins.findIndex(x => x._id.equals(sellItem.String));
if (index != -1) {
if (payload.SellCurrency == "SC_Resources") {
const itemType = inventory.CrewShipWeaponSkins[index].ItemType;
refundPartialBuildCosts(inventory, itemType, inventoryChanges);
refundPartialBuildCosts(
inventory,
inventory.CrewShipWeaponSkins[index].ItemType,
inventoryChanges
);
}
inventory.CrewShipWeaponSkins.splice(index, 1);
freeUpSlot(inventory, InventorySlot.RJ_COMPONENT_AND_ARMAMENTS);