Make ore loot use walls as a mask (#16377)

This commit is contained in:
metalgearsloth
2023-05-15 12:01:29 +10:00
committed by GitHub
parent 7065341171
commit ea4440be44
9 changed files with 187 additions and 135 deletions

View File

@@ -13,6 +13,7 @@ using Content.Shared.Atmos;
using Content.Shared.Dataset;
using Content.Shared.Gravity;
using Content.Shared.Parallax.Biomes;
using Content.Shared.Parallax.Biomes.Markers;
using Content.Shared.Procedural;
using Content.Shared.Procedural.Loot;
using Content.Shared.Random;
@@ -220,10 +221,20 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
switch (rule)
{
case BiomeTemplateLoot biomeLoot:
if (_entManager.TryGetComponent<BiomeComponent>(gridUid, out var biome))
case BiomeMarkerLoot biomeLoot:
{
_biome.AddTemplate(biome, "Loot", _prototypeManager.Index<BiomeTemplatePrototype>(biomeLoot.Prototype), i);
if (_entManager.TryGetComponent<BiomeComponent>(gridUid, out var biome))
{
_biome.AddMarkerLayer(biome, biomeLoot.Prototype);
}
}
break;
case BiomeTemplateLoot biomeLoot:
{
if (_entManager.TryGetComponent<BiomeComponent>(gridUid, out var biome))
{
_biome.AddTemplate(biome, "Loot", _prototypeManager.Index<BiomeTemplatePrototype>(biomeLoot.Prototype), i);
}
}
break;
// Spawns a cluster (like an ore vein) nearby.