refactor: duplicate identifier error

This commit is contained in:
Ilia Denisov
2026-02-11 09:46:24 +02:00
parent 6e84cc3c51
commit 5697d0ad57
9 changed files with 19 additions and 11 deletions
+5
View File
@@ -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()