refactor: float64 types for storage and report
This commit is contained in:
@@ -44,7 +44,7 @@ func (c *Cache) SendGroup(ri int, groupIndex, planetNumber, quantity uint) error
|
||||
if !ok {
|
||||
return e.NewEntityNotExistsError("destination planet #%d", planetNumber)
|
||||
}
|
||||
rangeToDestination := util.ShortDistance(c.g.Map.Width, c.g.Map.Height, p1.X, p1.Y, p2.X, p2.Y)
|
||||
rangeToDestination := util.ShortDistance(c.g.Map.Width, c.g.Map.Height, p1.X.F(), p1.Y.F(), p2.X.F(), p2.Y.F())
|
||||
if rangeToDestination > c.g.Race[ri].FlightDistance() {
|
||||
return e.NewSendUnreachableDestinationError("range=%.03f", rangeToDestination)
|
||||
}
|
||||
@@ -81,7 +81,7 @@ func (c *Cache) LaunchShips(sg *game.ShipGroup, destination uint) *game.ShipGrou
|
||||
default:
|
||||
panic("state invalid")
|
||||
}
|
||||
c.g.ShipGroups[i] = LaunchShips(*sg, destination, p.X, p.Y)
|
||||
c.g.ShipGroups[i] = LaunchShips(*sg, destination, p.X.F(), p.Y.F())
|
||||
return &c.g.ShipGroups[i]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user