diff options
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/server.c b/server.c index cc1bdc3..f9b16a5 100644 --- a/server.c +++ b/server.c @@ -238,10 +238,22 @@ static bool clientMove(struct Client *client, int8_t dx, int8_t dy) { client->cellX += dx; client->cellY += dy; - 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; } - if (client->cellY == UINT8_MAX) { client->tileY--; client->cellY = CELL_ROWS - 1; } + 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; + } + if (client->cellY == UINT8_MAX) { + client->tileY--; + client->cellY = CELL_ROWS - 1; + } if (client->tileX == TILE_COLS) client->tileX = 0; if (client->tileX == UINT32_MAX) client->tileX = TILE_COLS - 1; |