return error message when target is not ok
@@ -2828,6 +2828,10 @@ type CheckTargetResponse struct {
Type int `json:"type"`
Name string `json:"name"`
} `json:"targetPlanet"`
+ Errors []struct {
+ Message string `json:"message"`
+ Error int `json:"error"`
+ } `json:"errors"`
TargetOk bool `json:"targetOk"`
Components []interface{} `json:"components"`
}
@@ -2973,6 +2977,9 @@ func (b *OGame) sendFleetV7(celestialID CelestialID, ships []Quantifiable, speed
}
if !checkRes.TargetOk {
+ if len(checkRes.Errors) > 0 {
+ return Fleet{}, errors.New(checkRes.Errors[0].Message)
+ }
return Fleet{}, errors.New("target is not ok")
}
