Skip to content

Commit abf57d6

Browse files
committed
Fix bug with deserialization corner case
1 parent 39442db commit abf57d6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

snakeng/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.0"
1+
__version__ = "2.0.1"

snakeng/snake.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ def _serialize_snake_positions(positions):
134134
def _draw_line(startpos, endpos):
135135
diff = endpos - startpos
136136
direction = _direction_between_points(startpos, endpos, allow_jumps=True)
137-
move = _MOVEMAP[direction]
137+
if direction is None:
138+
return [Position(x=startpos.x, y=startpos.y)]
138139

140+
move = _MOVEMAP[direction]
139141
ret = [startpos]
140142
newpos = startpos
141143
while newpos != endpos:

0 commit comments

Comments
 (0)