refactor: duplicate identifier error
This commit is contained in:
@@ -383,6 +383,11 @@ func (c *Cache) ShipGroupBreak(ri int, groupID, newID uuid.UUID, quantity uint)
|
||||
if !ok {
|
||||
return e.NewEntityNotExistsError("group %s", groupID)
|
||||
}
|
||||
for sgi := range c.g.ShipGroups {
|
||||
if c.g.ShipGroups[sgi].ID == newID {
|
||||
return e.NewEntityDuplicateIdentifierError("group %s", newID)
|
||||
}
|
||||
}
|
||||
|
||||
if state := c.ShipGroup(sgi).State(); state != game.StateInOrbit {
|
||||
return e.NewShipsBusyError()
|
||||
|
||||
Reference in New Issue
Block a user