diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-03-29 14:21:54 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-03-29 14:21:54 +0300 |
commit | a75449b1d9d5012991db123f62a208860b3cd590 (patch) | |
tree | 83437dd258682ca05d6fd265cb1ea33e05be89ce | |
parent | 1ce760e73a10da34ef1360f64202d4d03492f859 (diff) | |
download | carcassonne-engine-c-a75449b1d9d5012991db123f62a208860b3cd590.tar.gz |
fix: don't allow overlapping tiles
-rw-r--r-- | src/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -23,6 +23,8 @@ int is_center_index(int index) { } int is_allowed_placement(char* tile, int index, char* board) { + if (board[index] != EMPTY) return 0; + for (int i = 0; i < 4; i++) { char neighbor = board[index + neighbor_increments[i]]; if (neighbor != EMPTY && neighbor != tile[i + 1]) return 0; |