Skip to content
Snippets Groups Projects
Commit 48a5d446 authored by Vrelnir's avatar Vrelnir
Browse files

Merge branch 'fix/invamount' into 'master'

Fix market inventory using all-time sold amount instead of summing up daily numbers

See merge request Vrelnir/degrees-of-lewdity!827
parents 06e5fd94 81be6f49
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@
<<set _plant_keys to Object.keys($plants)>>
<<set _total_worth to 0>>
<<set _total_amount to 0>>
<<set _total_sold_amount to 0>>
<<for _t to 0; _t lt _plant_keys.length; _t++>>
<<if ndef $stall_stats[_plant_keys[_t]]>>
<<set $stall_stats[_plant_keys[_t]] to { inventory:{amount:0, price:0, total:0}, sold:{amount:0, total:0} }>>
......@@ -76,6 +77,7 @@
<<else>>
<<set $stall_stats[_plant_keys[_t]].inventory to {amount:0, price:Math.round(setup.plants[$plants[_plant_keys[_t]].name].plant_cost), total:0}>>
<</if>>
<<set _total_sold_amount += $stall_stats[_plant_keys[_t]].sold.amount>>
<</for>>
<</silently>>
......@@ -215,7 +217,7 @@ total colums : - - - 2 3 5 6
<td style="border-top-width:4px;border-top-style:double"></td>
<td style="border-top-width:4px;border-top-style:double" align="right"><<printmoney _total_worth>></td>
<<if _canmath gte 5>>
<td style="border-top-width:4px;border-top-style:double" align="right">$produce_sold</td>
<td style="border-top-width:4px;border-top-style:double" align="right">_total_sold_amount</td>
<<if _canmath gte 6>>
<td style="border-top-width:4px;border-top-style:double"></td>
<</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment