:bugS: Fix natural resource generate missing iron

This commit is contained in:
2025-08-29 18:11:00 +08:00
parent ac1d8cfab9
commit 630dbf0800

View File

@@ -121,9 +121,9 @@ public partial class NaturalResourceGenerator : Node2D
}
// Generate stone veins
for (int x = 0; x < ChunkSize; x++)
for (var x = 0; x < ChunkSize; x++)
{
for (int y = 0; y < ChunkSize; y++)
for (var y = 0; y < ChunkSize; y++)
{
var cell = new Vector2I(chunkWorldPos.X + x, chunkWorldPos.Y + y);
if (_rng.Randf() < StoneDensity)
@@ -131,6 +131,11 @@ public partial class NaturalResourceGenerator : Node2D
var veinSize = _rng.RandiRange(MinStoneVeinSize, MaxStoneVeinSize);
PlaceVeinInBackground(cell, "stone", veinSize, chunkData.StoneTiles);
}
else if (_rng.Randf() < IronDensity)
{
var veinSize = _rng.RandiRange(MinIronVeinSize, MaxIronVeinSize);
PlaceVeinInBackground(cell, "ore_iron", veinSize, chunkData.IronTiles);
}
}
}