From dca191ccae0d793b315d3dbf8aacf5d20ba33067 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 18 Jul 2020 22:26:13 +0100 Subject: [PATCH] don't allow tiles with an ID of 0 --- src/game.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.rs b/src/game.rs index d47696e..4e8a92d 100644 --- a/src/game.rs +++ b/src/game.rs @@ -692,7 +692,7 @@ impl Game { /// adds a tile safely and returns the ID #[inline] pub fn add_tile(&mut self, mut tile: Tile) -> String { - if self.tile_ids().contains(&tile.id) { + if tile.id == "0".to_string() || self.tile_ids().contains(&tile.id) { let new_id = self.new_tile_id(); if new_id != tile.id { tile.id = new_id;