From 370d198431389207cae2521ff186437eba3ef729 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Wed, 23 Nov 2011 23:10:04 -0800 Subject: [PATCH] Private flag --- planeteer.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/planeteer.go b/planeteer.go index 5e406fa..e9f10c7 100644 --- a/planeteer.go +++ b/planeteer.go @@ -110,6 +110,7 @@ type Commodity struct { } type Planet struct { BeaconOn bool + Private bool /* Use relative prices rather than absolute prices because you can get relative prices without traveling to each planet. */ RelativePrices map[string]int @@ -336,6 +337,10 @@ func FillCellByArriving(data planet_data, dims []int, table []State, addr []int) } func FillCellBySelling(data planet_data, dims []int, table []State, addr []int) { + if data.Planets[data.i2p[addr[Location]]].Private { + // Can't do commerce on private planets + return + } if addr[Hold] > 0 { // Can't sell and still have cargo return @@ -373,6 +378,10 @@ func FillCellBySelling(data planet_data, dims []int, table []State, addr []int) } func FillCellByBuying(data planet_data, dims []int, table []State, addr []int) { + if data.Planets[data.i2p[addr[Location]]].Private { + // Can't do commerce on private planets + return + } if addr[Hold] == 0 { // Can't buy and then have nothing return -- 2.44.1