]> git.scottworley.com Git - planeteer/commitdiff
Buy from the right cell (no UnusedCargo when empty)
authorScott Worley <sworley@chkno.net>
Thu, 3 Nov 2011 20:56:46 +0000 (13:56 -0700)
committerScott Worley <sworley@chkno.net>
Thu, 3 Nov 2011 20:56:46 +0000 (13:56 -0700)
planeteer.go

index 1de46879faaad85b3d4a64c93af0cc0212ee61d2..6f6f7b758c849c6b4be6efda5da317292a6d7925 100644 (file)
@@ -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) {