Skip to content

Commit

Permalink
this is better
Browse files Browse the repository at this point in the history
  • Loading branch information
Iajret committed Nov 5, 2023
1 parent a3b78f4 commit edf7e58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/modules/cargo/exports/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand All @@ -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))

0 comments on commit edf7e58

Please sign in to comment.