Explorar el Código

fix tap if x is tuple

Richard Köhl hace 1 año
padre
commit
6f6d78af41
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      dungeon.py

+ 3 - 0
dungeon.py

@@ -83,6 +83,9 @@ def tap(name, x, y=None):
     sleep += random.uniform(0, 0.2)
     text = f"- {name} (pause for {sleep}s)"
 
+    if y is None and isinstance(x, tuple):
+        x, y, *_ = x
+
     tap_helper(x + random.randint(-3, 3), y + random.randint(-3, 3), text)
     time.sleep(sleep)