From c527188a00349fa557c0c2679a12deae2642f136 Mon Sep 17 00:00:00 2001
From: Robin Ruud Kristensen <robin1998@hotmail.no>
Date: Thu, 10 Nov 2022 20:50:10 +0100
Subject: [PATCH] maybe fixed spawning of enemies

---
 MrBigsock/Assets/Code/Map/TilemapGenerator.cs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MrBigsock/Assets/Code/Map/TilemapGenerator.cs b/MrBigsock/Assets/Code/Map/TilemapGenerator.cs
index a5dd3007..8b83cd3a 100644
--- a/MrBigsock/Assets/Code/Map/TilemapGenerator.cs
+++ b/MrBigsock/Assets/Code/Map/TilemapGenerator.cs
@@ -252,7 +252,9 @@ namespace Bigsock
             {
                 int enemyRandom = Random.Range(0, Enemy.Length);
                 int randomLocation_x = Random.Range(1, map.GetUpperBound(0) - 1);
+                if (randomLocation_x == DoorLocations[roomNr].x) randomLocation_x += 1;
                 int randomLocation_y = Random.Range(map.GetLowerBound(1) + 2, map.GetUpperBound(1) - 1);
+                if (randomLocation_x == DoorLocations[roomNr].y) randomLocation_y += 1;
                 Instantiate(Enemy[enemyRandom], new Vector3Int((int)FloorTilemap[roomNr].transform.position.x + randomLocation_x,
                     (int)FloorTilemap[roomNr].transform.position.y + randomLocation_y, 0), Quaternion.identity);
             }
-- 
GitLab