public void ConvertDoor(VirtualMap map, VirtualCell conversion_cell) { if (conversion_cell.IsDoor()) { if (!behaviour.drawDoors) { conversion_cell.Type = VirtualCell.CellType.EmptyPassage; } else { CellLocation prev_loc = map.GetNeighbourCellLocation(conversion_cell.location, conversion_cell.Orientation); CellLocation next_loc = map.GetNeighbourCellLocation(conversion_cell.location, map.GetDirectionOpposite(conversion_cell.Orientation)); // Debug.Log (prev_loc); // Debug.Log (next_loc); // Debug.Log (map.GetCell(prev_loc).IsRoomFloor()); // Debug.Log (map.GetCell(next_loc).IsRoomFloor()); if (map.GetCell(prev_loc).IsRoomFloor() && map.GetCell(next_loc).IsRoomFloor()) { conversion_cell.Type = VirtualCell.CellType.RoomDoor; } } } }