diff --git a/code/modules/cargo/exports/materials.dm b/code/modules/cargo/exports/materials.dm index 59b2b7f157b..c38f74e228d 100644 --- a/code/modules/cargo/exports/materials.dm +++ b/code/modules/cargo/exports/materials.dm @@ -139,7 +139,7 @@ return if(!dry_run) SSstock_market.materials_quantity[material_id] += amount - SSstock_market.materials_prices[material_id] -= round((SSstock_market.materials_prices[material_id]) * (amount / (SSstock_market.materials_quantity[material_id]))) + SSstock_market.materials_prices[material_id] -= round((SSstock_market.materials_prices[material_id]) * (amount / SSstock_market.materials_quantity[material_id])) //This formula should impact lower quantity materials greater, and higher quantity materials less. Still, it's a bit rough. Tweaking may be needed. @@ -160,5 +160,5 @@ var/obj/item/stock_block/sold_block = sold_item var/sale_value = sold_block.export_value SSstock_market.materials_quantity[sold_block.export_mat] += sold_block.quantity - SSstock_market.materials_prices[sold_block.export_mat] -= round((sale_value) * (sold_block.quantity / (sold_block.quantity + SSstock_market.materials_quantity[sold_block.export_mat]))) + SSstock_market.materials_prices[sold_block.export_mat] -= round((SSstock_market.materials_prices[sold_block.export_mat]) * (sold_block.quantity / SSstock_market.materials_quantity[sold_block.export_mat])) SSstock_market.materials_prices[sold_block.export_mat] = round(clamp(SSstock_market.materials_prices[sold_block.export_mat], initial(sold_block.export_mat.value_per_unit) * SHEET_MATERIAL_AMOUNT * 0.5 , initial(sold_block.export_mat.value_per_unit) * SHEET_MATERIAL_AMOUNT * 3))