Base cargo should be used to compare with deut consumption
@@ -2256,12 +2256,13 @@ func (b *OGame) sendFleet(celestialID CelestialID, ships []Quantifiable, speed S
if deutConsumption > resourcesAvailable.Deuterium {
return Fleet{}, fmt.Errorf("not enough deuterium, avail: %d, need: %d", resourcesAvailable.Deuterium, deutConsumption)
}
- finalCargo := ParseInt(fleet3Doc.Find("#maxresources").Text())
+ // finalCargo := ParseInt(fleet3Doc.Find("#maxresources").Text())
+ baseCargo := finalShips.Cargo(Researches{})
if b.GetServer().Settings.EspionageProbeRaids != 1 {
- finalCargo += finalShips.EspionageProbe * EspionageProbe.BaseCargoCapacity
+ baseCargo += finalShips.EspionageProbe * EspionageProbe.BaseCargoCapacity
}
- if deutConsumption > finalCargo {
- return Fleet{}, fmt.Errorf("not enough cargo capacity, avail: %d, need: %d", finalCargo, deutConsumption)
+ if deutConsumption > baseCargo {
+ return Fleet{}, fmt.Errorf("not enough cargo capacity, avail: %d, need: %d", baseCargo, deutConsumption)
}
payload.Add("crystal", strconv.Itoa(resources.Crystal))
payload.Add("deuterium", strconv.Itoa(resources.Deuterium))
