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
+1 -1
View File
@@ -21,7 +21,7 @@ func (c *Cache) ShipClassCreate(ri int, typeName string, drive float64, ammo int
return e.NewEntityTypeNameValidationError("%q", n)
}
if st := slices.IndexFunc(c.g.Race[ri].ShipTypes, func(st game.ShipType) bool { return st.Name == typeName }); st >= 0 {
return e.NewEntityTypeNameDuplicateError("ship type %q", c.g.Race[ri].ShipTypes[st].Name)
return e.NewEntityDuplicateIdentifierError("ship class %q", c.g.Race[ri].ShipTypes[st].Name)
}
c.g.Race[ri].ShipTypes = append(c.g.Race[ri].ShipTypes, game.ShipType{
ID: uuid.New(),