aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/integration/webdiplomacy_net/orders.py
diff options
context:
space:
mode:
authorPhilip Paquette <pcpaquette@gmail.com>2019-08-21 20:13:13 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-08-21 20:45:22 -0400
commit63e79a4e0e1db39bb54af22c849756d7fd7b9f57 (patch)
tree29c587ab2125bf78fcff54e1bb34a78f96890d50 /diplomacy/integration/webdiplomacy_net/orders.py
parent22ae5e3672ff630e6db5159591e880b4ba1292cd (diff)
[API] Converting '-' to 'R' during retreats phase
Diffstat (limited to 'diplomacy/integration/webdiplomacy_net/orders.py')
-rw-r--r--diplomacy/integration/webdiplomacy_net/orders.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/diplomacy/integration/webdiplomacy_net/orders.py b/diplomacy/integration/webdiplomacy_net/orders.py
index 60cc86a..afacf03 100644
--- a/diplomacy/integration/webdiplomacy_net/orders.py
+++ b/diplomacy/integration/webdiplomacy_net/orders.py
@@ -166,6 +166,11 @@ class Order():
:type game: diplomacy.Game
"""
# pylint: disable=too-many-return-statements,too-many-branches,too-many-statements
+ # Converting move to retreat during retreat phase
+ if self.phase_type == 'R':
+ order = order.replace(' - ', ' R ')
+
+ # Splitting into parts
words = order.split()
# --- Wait / Waive ---