don't allow tiles with an ID of 0

This commit is contained in:
Max Bradbury 2020-07-18 22:26:13 +01:00
parent c42d7262da
commit dca191ccae
1 changed files with 1 additions and 1 deletions

View File

@ -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;