mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'christof/minimum_price' into 'master'
Enforce a minimum price for goods See merge request veloren/veloren!3335
This commit is contained in:
commit
c78253e8a6
@ -270,9 +270,10 @@ impl Economy {
|
||||
let labor_values = normalize(self.labor_values);
|
||||
// Use labor values as prices. Not correct (doesn't care about exchange value)
|
||||
let prices = normalize(self.values).map(|good, value| {
|
||||
(labor_values[good].unwrap_or(Economy::MINIMUM_PRICE)
|
||||
((labor_values[good].unwrap_or(Economy::MINIMUM_PRICE)
|
||||
+ value.unwrap_or(Economy::MINIMUM_PRICE))
|
||||
* 0.5
|
||||
* 0.5)
|
||||
.max(Economy::MINIMUM_PRICE)
|
||||
});
|
||||
prices.iter().map(|(g, v)| (Good::from(g), *v)).collect()
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user