From 0c5568b6a60d67bbbf84fd037d41826ccc497b8e Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sun, 3 Sep 2017 15:34:21 -0400 Subject: Assert client coords are valid after movement --- server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.c b/server.c index 09bd36b..c3b594b 100644 --- a/server.c +++ b/server.c @@ -249,6 +249,11 @@ static bool clientMove(struct Client *client, int8_t dx, int8_t dy) { if (client->tileY == TILE_ROWS) client->tileY = 0; if (client->tileY == UINT32_MAX) client->tileY = TILE_ROWS - 1; + assert(client->cellX < CELL_COLS); + assert(client->cellY < CELL_ROWS); + assert(client->tileX < TILE_COLS); + assert(client->tileY < TILE_ROWS); + return clientUpdate(client, &old); } -- cgit 1.4.1