aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/integration/webdiplomacy_net/orders.py
diff options
context:
space:
mode:
authorPhilip Paquette <pcpaquette@gmail.com>2019-08-21 20:12:55 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-08-21 20:45:22 -0400
commit22ae5e3672ff630e6db5159591e880b4ba1292cd (patch)
tree64ce28470c8b483955128b4d193d56df65ccee79 /diplomacy/integration/webdiplomacy_net/orders.py
parent5c3bd9b3802e2001a7e77baf2911386135a03839 (diff)
[API] Disband order during 'A' phase strips the coast
Diffstat (limited to 'diplomacy/integration/webdiplomacy_net/orders.py')
-rw-r--r--diplomacy/integration/webdiplomacy_net/orders.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/diplomacy/integration/webdiplomacy_net/orders.py b/diplomacy/integration/webdiplomacy_net/orders.py
index 73dc1a9..60cc86a 100644
--- a/diplomacy/integration/webdiplomacy_net/orders.py
+++ b/diplomacy/integration/webdiplomacy_net/orders.py
@@ -392,6 +392,7 @@ class Order():
# --- Disband (R phase) ---
# {"id": "152", "unitID": "18", "type": "Disband", "toTerrID": "", "fromTerrID": "", "viaConvoy": ""}
elif order_type == 'D' and self.phase_type == 'R':
+ # Note: For R phase, we disband with the coast
self.order_str = '%s %s D' % (short_unit_type, loc_name)
self.order_dict = {'terrID': terr_id,
'unitType': unit_type,
@@ -425,6 +426,9 @@ class Order():
# Disband (A phase)
# {"id": "152", "unitID": null, "type": "Destroy", "toTerrID": "18", "fromTerrID": "", "viaConvoy": ""}
elif order_type == 'D':
+ # For A phase, we disband without the coast
+ loc_name = loc_name[:3]
+ terr_id = CACHE[self.map_name]['loc_to_ix'][loc_name]
self.order_str = '%s %s D' % (short_unit_type, loc_name)
self.order_dict = {'terrID': terr_id,
'unitType': unit_type,