about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/server.c b/server.c
index fc35640..3c26f09 100644
--- a/server.c
+++ b/server.c
@@ -67,6 +67,16 @@ static struct Tile *tileAccess(uint32_t tileX, uint32_t tileY) {
 	struct Tile *tile = tileGet(tileX, tileY);
 	tile->accessTime = time(NULL);
 	tile->accessCount++;
+#ifndef NO_DECAY
+	uint8_t y = arc4random_uniform(CellRows);
+	uint8_t x = arc4random_uniform(CellCols);
+	uint8_t b = 1 << arc4random_uniform(8);
+	if (arc4random_uniform(2)) {
+		tile->cells[y][x] &= ~b;
+	} else {
+		tile->colors[y][x] &= ~b;
+	}
+#endif
 	return tile;
 }