diff options
author | June McEnroe <june@causal.agency> | 2021-12-01 15:40:17 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-12-01 15:40:17 -0500 |
commit | 9e505a78a500f50721b59c0263cee311145ac400 (patch) | |
tree | 5b0b9f45b9feea38c205dbf083b0fe0fc568f84f /server.c | |
parent | Remove capsicum support (diff) | |
download | torus-9e505a78a500f50721b59c0263cee311145ac400.tar.gz torus-9e505a78a500f50721b59c0263cee311145ac400.zip |
Decay
Diffstat (limited to '')
-rw-r--r-- | server.c | 10 |
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; } |