Make the sentient plant mutation non-copyable to other plantholders (#29133)

make the sentient plant mutation not propagate by clipping, using the seed extractor or cryoxadone
This commit is contained in:
slarticodefast
2024-08-11 11:23:14 +02:00
committed by GitHub
parent 456410239e
commit bd5d415575
3 changed files with 32 additions and 9 deletions

View File

@@ -42,12 +42,19 @@ public sealed class SeedExtractorSystem : EntitySystem
var amount = _random.Next(seedExtractor.BaseMinSeeds, seedExtractor.BaseMaxSeeds + 1);
var coords = Transform(uid).Coordinates;
var packetSeed = seed;
if (packetSeed.Sentient)
{
if (!packetSeed.Unique) // clone if necessary before modifying the seed
packetSeed = packetSeed.Clone();
packetSeed.Sentient = false; // remove Sentient to avoid ghost role spam
}
if (amount > 1)
seed.Unique = false;
packetSeed.Unique = false;
for (var i = 0; i < amount; i++)
{
_botanySystem.SpawnSeedPacket(seed, coords, args.User);
_botanySystem.SpawnSeedPacket(packetSeed, coords, args.User);
}
}
}