File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,16 @@ var/global/list/cargoprices = list()
1919 . = .. () // make sure children are set up
2020 if (is_category())
2121 return // don't do any of this for categories
22+ var /total_contained = 0
23+ for (var /entry in contains)
24+ total_contained += max(1 , contains[entry])
2225 if (! num_contained)
23- for (var /entry in contains)
24- num_contained += max(1 , contains[entry])
26+ num_contained = total_contained
2527 if (isnull(cost))
2628 cost = 0
2729 for (var /entry in contains)
2830 cost += atom_info_repository. get_combined_worth_for(entry) * max (1 , contains[entry])
31+ cost *= num_contained / total_contained // if you get a random selection, it costs the expected value rather than the total worth. gambling!
2932 cost += containertype ? atom_info_repository. get_single_worth_for(containertype) : 0
3033 cost = max(1 , NONUNIT_CEILING ((cost * WORTH_TO_SUPPLY_POINTS_CONSTANT * SSsupply. price_markup), WORTH_TO_SUPPLY_POINTS_ROUND_CONSTANT ))
3134 global . cargoprices[name] = cost
You can’t perform that action at this time.
0 commit comments