From ca448f3dc88b8737e641cb9019664695eab80e51 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 31 Jul 2017 00:22:07 -0400 Subject: Handle large moves --- server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index 8892d2d..cea66c1 100755 --- a/server.c +++ b/server.c @@ -129,13 +129,17 @@ static bool clientCast(struct Client *origin, const struct ServerMessage *msg) { return success; } -static bool clientMove(struct Client *client, int8_t dx, uint8_t dy) { +static bool clientMove(struct Client *client, int8_t dx, int8_t dy) { struct Client old = *client; + if (dx > CELL_COLS - client->cellX) dx = CELL_COLS - client->cellX; + if (dx < -client->cellX - 1) dx = -client->cellX - 1; + if (dy > CELL_ROWS - client->cellY) dy = CELL_ROWS - client->cellY; + if (dy < -client->cellY - 1) dy = -client->cellY - 1; + client->cellX += dx; client->cellY += dy; - // TODO: Handle moves greater than 1 in either direction. if (client->cellX == CELL_COLS) { client->tileX++; client->cellX = 0; } if (client->cellX == UINT8_MAX) { client->tileX--; client->cellX = CELL_COLS - 1; } if (client->cellY == CELL_ROWS) { client->tileY++; client->cellY = 0; } -- cgit 1.4.1 6405c09'>tree commit diff
path: root/README.7 (unfollow)
Commit message (Collapse)Author
2020-01-16Add scoop flag for local timeJune McEnroe
2020-01-14Remove note about usernames for pounceJune McEnroe
This is done automatically with the causal.agency/passive capability now.
2020-01-14Reference IRCv3.1 SASL specJune McEnroe
2020-01-14Ensure ansi resets formatting and null-terminatesJune McEnroe
fmemopen in text-mode only ensures the buffer is null-terminated if the last write does not fill the buffer.
2020-01-14Implement IRC formatting to ANSI translationJune McEnroe
2020-01-14Add -b flag for live backupJune McEnroe
2020-01-14Add columnsize = 0 option to FTS indexJune McEnroe
Since we don't use ranking functions and I don't see them being useful, there is no point in having columnsize, which just takes extra space in the database. In my database of approximately 3.5 million events, disabling columnsize saves about 62 MB. The migration unfortunately has to rebuild the entire index to disable it.
2020-01-12Add option for client cert and SASL EXTERNALJune McEnroe
2020-01-12Add Linux.mkJune McEnroe
2020-01-11Fix unscoop dedup window syntaxJune McEnroe
2020-01-11Bump busy timeout to 10sJune McEnroe