From: Scott Worley Date: Thu, 3 Nov 2011 20:56:46 +0000 (-0700) Subject: Buy from the right cell (no UnusedCargo when empty) X-Git-Url: http://git.scottworley.com/planeteer/commitdiff_plain/797391f853ed1af8da9f37d9367edf3e162203b7?ds=sidebyside Buy from the right cell (no UnusedCargo when empty) --- diff --git a/planeteer.go b/planeteer.go index 1de4687..6f6f7b7 100644 --- a/planeteer.go +++ b/planeteer.go @@ -354,7 +354,10 @@ func FillCellByBuying(data planet_data, dims []int, table []State, addr []int) { quantity := *hold - (addr[UnusedCargo] + addr[Cloaks] + addr[Edens]) total_price := quantity * absolute_price other[Hold] = 0 + other[UnusedCargo] = 0 UpdateCell(table, my_index, EncodeIndex(dims, other), -total_price) + other[UnusedCargo] = addr[UnusedCargo] + other[Hold] = addr[Hold] } func FillCellByMisc(data planet_data, dims []int, table []State, addr []int) {