fix: ship production math
This commit is contained in:
committed by
Ilia Denisov
parent
9088cc77c9
commit
327f2865d4
@@ -536,14 +536,12 @@ func (c *Cache) ReportShipProduction(ri int, rep *mr.Report) {
|
||||
st := c.MustShipType(ri, *p.Production.SubjectID)
|
||||
|
||||
sliceIndexValidate(&rep.ShipProduction, i)
|
||||
free := c.PlanetProductionCapacity(p.Number)
|
||||
rep.ShipProduction[pi].Planet = p.Number
|
||||
rep.ShipProduction[pi].Class = st.Name
|
||||
rep.ShipProduction[pi].Cost = mr.F(ShipProductionCost(st.EmptyMass()))
|
||||
rep.ShipProduction[pi].Free = mr.F(free)
|
||||
|
||||
// FIXME: take logic from [ProduceShip] and test at [controller_test.TestProduceShip]
|
||||
rep.ShipProduction[pi].Wasted = mr.F(free * (*p.Production.Progress).F())
|
||||
rep.ShipProduction[pi].Free = mr.F(c.PlanetProductionCapacity(p.Number))
|
||||
rep.ShipProduction[pi].ProdUsed = mr.F((*p.Production.ProdUsed).F())
|
||||
rep.ShipProduction[pi].Percent = mr.F((*p.Production.Progress).F())
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user