handle pitstops without costs properly
This commit is contained in:
parent
158c419747
commit
cd9fc4755e
|
@ -38,6 +38,8 @@ class ConsumableStats:
|
||||||
for pitstop in pitstops:
|
for pitstop in pitstops:
|
||||||
self.overall_amount += pitstop.amount
|
self.overall_amount += pitstop.amount
|
||||||
self.amounts.append(StatsEvent(pitstop.date, pitstop.amount))
|
self.amounts.append(StatsEvent(pitstop.date, pitstop.amount))
|
||||||
|
# some pitstops seem to have lost their costs...
|
||||||
|
if pitstop.costs:
|
||||||
self.price.append(StatsEvent(pitstop.date, pitstop.costs/pitstop.amount))
|
self.price.append(StatsEvent(pitstop.date, pitstop.costs/pitstop.amount))
|
||||||
self.average_amount_fuelled = self.overall_amount / pitstop_count
|
self.average_amount_fuelled = self.overall_amount / pitstop_count
|
||||||
if pitstop_count > 1:
|
if pitstop_count > 1:
|
||||||
|
|
Loading…
Reference in New Issue