fix: ship send without any planets left

This commit is contained in:
Ilia Denisov
2026-02-17 19:57:08 +02:00
parent d42cee9df1
commit f394c105b0
4 changed files with 27 additions and 7 deletions
+4 -1
View File
@@ -27,7 +27,8 @@ const (
ErrUpgradeInsufficientResources = 5011
ErrSendShipHasNoDrives = 5012
ErrSendUnreachableDestination = 5013
ErrRaceExinct = 5014
ErrSendShipOwnerHasNoPlanets = 5014
ErrRaceExinct = 5015
)
const (
@@ -165,6 +166,8 @@ func GenericErrorText(code int) string {
return "One or more ships are not equipped with hyperdrive and cannot be moved"
case ErrSendUnreachableDestination:
return "Destination planet is too far for current Drive level"
case ErrSendShipOwnerHasNoPlanets:
return "Race is not owning any planet, all flights impossible"
case ErrRaceExinct:
return "Race is extinct"
default:
+4
View File
@@ -167,3 +167,7 @@ func NewSendShipHasNoDrivesError(arg ...any) error {
func NewSendUnreachableDestinationError(arg ...any) error {
return newGenericError(ErrSendUnreachableDestination, arg...)
}
func NewSendShipOwnerHasNoPlanetsError(arg ...any) error {
return newGenericError(ErrSendShipOwnerHasNoPlanets, arg...)
}