From 1d86615834e3a454a9a5ce58880c2ddf6401c8a2 Mon Sep 17 00:00:00 2001 From: drcarademono <73616371+drcarademono@users.noreply.github.com> Date: Mon, 25 Mar 2024 12:52:22 -0700 Subject: [PATCH] Removed terrainOccupied and DF location checks for type 0 locations I now account for DF locations while placing WoD instances. It should now be permissible for there to be multiple WoD instances in a single map pixel, or to be in the same map pixel as a DF location. --- Scripts/LocationLoader.cs | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Scripts/LocationLoader.cs b/Scripts/LocationLoader.cs index 4216be6..fc27c9b 100644 --- a/Scripts/LocationLoader.cs +++ b/Scripts/LocationLoader.cs @@ -451,14 +451,14 @@ void OnTerrainPromoted(DaggerfallTerrain daggerTerrain, TerrainData terrainData) { string context = $"location=\"{loc.name}\""; - if (daggerTerrain.MapData.hasLocation) - { - if (loc.type == 0) - { - Debug.LogWarning($"Location already present at ({daggerTerrain.MapPixelX}, {daggerTerrain.MapPixelY}) ({context})"); - continue; - } - } + //if (daggerTerrain.MapData.hasLocation) + //{ + // if (loc.type == 0) + // { + // Debug.LogWarning($"Location already present at ({daggerTerrain.MapPixelX}, {daggerTerrain.MapPixelY}) ({context})"); + // continue; + // } + //} LocationPrefab locationPrefab = resourceManager.GetPrefabInfo(loc.prefab); if (locationPrefab == null) @@ -481,10 +481,10 @@ void OnTerrainPromoted(DaggerfallTerrain daggerTerrain, TerrainData terrainData) continue; } - if (PruneInstance(loc, locationPrefab)) - { - continue; - } + //if (PruneInstance(loc, locationPrefab)) // carademono: Removing location check as type 0 placement now avoids overlaps and places multiples multiples per map pixel + //{ + // continue; + //} if (loc.type == 2) { @@ -504,14 +504,14 @@ void OnTerrainPromoted(DaggerfallTerrain daggerTerrain, TerrainData terrainData) FindRiverCrossingCenter(loc, locationPrefab); } - if (loc.type == 0) - { - if (terrainOccupied) - { - Debug.LogWarning($"Location instance already present at ({daggerTerrain.MapPixelX}, {daggerTerrain.MapPixelY}) ({context})"); - continue; - } - } + //if (loc.type == 0) // carademono: Removing terrainOccupied check as type 0 placement now avoids overlaps and places multiples multiples per map pixel + //{ + // if (terrainOccupied) + // { + // Debug.LogWarning($"Location instance already present at ({daggerTerrain.MapPixelX}, {daggerTerrain.MapPixelY}) ({context})"); + // continue; + // } + //} int count = 0; float tmpAverageHeight = 0;