Ver Fonte

Don't attempt to trade with Special/StarDock ports.

Steve Thielemann há 5 anos atrás
pai
commit
fa93f3b8c0
1 ficheiros alterados com 8 adições e 0 exclusões
  1. 8 0
      galaxy.py

+ 8 - 0
galaxy.py

@@ -288,6 +288,9 @@ class GameData(object):
             return True
 
         cargo_index = cargo_to_index[cargo]
+        if port["port"] in ('Special', 'StarDock'):
+            log.warn("port_buying( {0}, {1}): not buying (is {2})".format(sector, cargo, port['port']))
+            return False
         if port["port"][cargo_index] == "S":
             log.warn("port_buying( {0}, {1}): not buying cargo".format(sector, cargo))
             return False
@@ -343,6 +346,9 @@ class GameData(object):
         # Given the port settings, can we trade between these?
         if port1 == port2:
             return False
+        if port1 in ('Special', 'StarDock') or port2 in ('Special', 'StarDock'):
+            return False
+
         p1 = [c for c in port1]
         p2 = [c for c in port2]
         rem = False
@@ -468,6 +474,8 @@ class GameData(object):
                 if s in self.ports:
                     # Ok, possibly?
                     sp = self.ports[s]
+                    if sp['port'] in ('Special', 'StarDock'):
+                        continue
                     if sp["port"][s_pos] == "S":
                         # Ok, they are selling!
                         if sell in sp: