feat: remove instant group breaking
This commit is contained in:
@@ -101,7 +101,7 @@ func (c *Cache) FleetSpeedAndMass(fi int) (float64, float64) {
|
||||
return speed, mass
|
||||
}
|
||||
|
||||
func (c *Cache) ShipGroupJoinFleet(ri int, fleetName string, groupID uuid.UUID, quantity uint) (err error) {
|
||||
func (c *Cache) ShipGroupJoinFleet(ri int, fleetName string, groupID uuid.UUID) (err error) {
|
||||
c.validateRaceIndex(ri)
|
||||
name, ok := util.ValidateTypeName(fleetName)
|
||||
if !ok {
|
||||
@@ -116,10 +116,6 @@ func (c *Cache) ShipGroupJoinFleet(ri int, fleetName string, groupID uuid.UUID,
|
||||
return e.NewShipsBusyError("state: %s", state)
|
||||
}
|
||||
|
||||
if c.ShipGroup(sgi).Number < quantity {
|
||||
return e.NewJoinFleetGroupNumberNotEnoughError("%d<%d", c.ShipGroup(sgi).Number, quantity)
|
||||
}
|
||||
|
||||
var oldFleetID *uuid.UUID
|
||||
if c.ShipGroup(sgi).FleetID != nil {
|
||||
fID := *c.ShipGroup(sgi).FleetID
|
||||
@@ -139,14 +135,6 @@ func (c *Cache) ShipGroupJoinFleet(ri int, fleetName string, groupID uuid.UUID,
|
||||
}
|
||||
}
|
||||
|
||||
if quantity > 0 && quantity < c.ShipGroup(sgi).Number {
|
||||
nsgi, err := c.breakGroup(ri, groupID, quantity)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sgi = nsgi
|
||||
}
|
||||
|
||||
c.internalShipGroupJoinFleet(sgi, &c.g.Fleets[fi].ID)
|
||||
|
||||
if oldFleetID != nil {
|
||||
|
||||
Reference in New Issue
Block a user