about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-08 15:44:32 -0500
committerJune McEnroe <june@causal.agency>2019-01-08 15:44:32 -0500
commitff29f89d37025e8fe332043abadec9574fa77652 (patch)
treeb4177a6577ac7802bb3213dc639cda6ae29e4f10
parentFactor out default paths (diff)
downloadtorus-ff29f89d37025e8fe332043abadec9574fa77652.tar.gz
torus-ff29f89d37025e8fe332043abadec9574fa77652.zip
Draw lines to tile edge
Diffstat (limited to '')
-rw-r--r--client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/client.c b/client.c
index e2f3596..4d48e9d 100644
--- a/client.c
+++ b/client.c
@@ -652,14 +652,16 @@ static void inputLine(bool keyCode, wchar_t ch) {
 			break; default: return;
 		}
 	}
-	if ((uint8_t)(cellX + dx) >= CellCols) return;
-	if ((uint8_t)(cellY + dy) >= CellRows) return;
 
 	uint8_t leave = lineCell(tile.cells[cellY][cellX], dx, dy);
 	uint8_t enter = lineCell(tile.cells[cellY + dy][cellX + dx], -dx, -dy);
 
 	if (leave) clientPut(input.color, leave);
+
+	if ((uint8_t)(cellX + dx) >= CellCols) return;
+	if ((uint8_t)(cellY + dy) >= CellRows) return;
 	clientMove(dx, dy);
+
 	if (enter) clientPut(input.color, enter);
 }