]> git.scottworley.com Git - planeteer/commitdiff
Fix a legal-path-not-checked eden warp bug
authorScott Worley <sworley@chkno.net>
Mon, 17 Sep 2012 08:13:33 +0000 (01:13 -0700)
committerScott Worley <sworley@chkno.net>
Mon, 17 Sep 2012 08:13:33 +0000 (01:13 -0700)
You don't need to have a free cargo slot after warping if the hold is empty.

planeteer.go

index 6c8f087feef72dff1eea89d4ee37d5006e66cdd9..1074e92a377c13205e8adb335912ce43523568b3 100644 (file)
@@ -399,7 +399,7 @@ func CellValue(data planet_data, dims LogicalIndex, table []State, addr LogicalI
                }
 
                /* Travel here via Eden Warp Unit */
-               if addr[Edens]+1 < dims[Edens] && addr[UnusedCargo] > 0 {
+               if addr[Edens]+1 < dims[Edens] && (addr[Hold] == 0 || addr[UnusedCargo] > 0) {
                        _, available := data.Planets[data.i2p[addr[Location]]].RelativePrices["Eden Warp Units"]
                        if !available {
                                other[Edens] = addr[Edens] + 1