X-Git-Url: http://git.scottworley.com/planeteer/blobdiff_plain/1c1ede6836ed424330981ce160a8dd38e6759f48..0c27c3442a12e844cb7459037f20a32705440bab:/planeteer.go diff --git a/planeteer.go b/planeteer.go index c207c13..85b07a1 100644 --- a/planeteer.go +++ b/planeteer.go @@ -278,7 +278,9 @@ func FillCellByArriving(data planet_data, dims []int, table []State, addr []int) if addr[Fuel]+2 < dims[Fuel] { other[Fuel] = addr[Fuel] + 2 for other[Location] = 0; other[Location] < dims[Location]; other[Location]++ { - UpdateCell(table, my_index, EncodeIndex(dims, other), 0) + if data.Planets[data.i2p[addr[Location]]].BeaconOn { + UpdateCell(table, my_index, EncodeIndex(dims, other), 0) + } } other[Location] = addr[Location] other[Fuel] = addr[Fuel] @@ -298,13 +300,17 @@ func FillCellByArriving(data planet_data, dims []int, table []State, addr []int) } /* Travel here via Eden Warp Unit */ - for other[Edens] = addr[Edens] + 1; other[Edens] < dims[Edens]; other[Edens]++ { - for other[Location] = 0; other[Location] < dims[Location]; other[Location]++ { - UpdateCell(table, my_index, EncodeIndex(dims, other), 0) + if addr[Edens]+1 < dims[Edens] { + _, available := data.Planets[data.i2p[addr[Location]]].RelativePrices["Eden Warp Units"] + if !available { + other[Edens] = addr[Edens] + 1 + for other[Location] = 0; other[Location] < dims[Location]; other[Location]++ { + UpdateCell(table, my_index, EncodeIndex(dims, other), 0) + } + other[Location] = addr[Location] + other[Edens] = addr[Edens] } } - other[Location] = addr[Location] - other[Edens] = addr[Edens] } func FillCellBySelling(data planet_data, dims []int, table []State, addr []int) {