Unstable v0.19.3.0

This commit is contained in:
Juan Pablo Arce
2022-09-02 15:10:56 -03:00
parent 28789616bd
commit 3f2c843247
336 changed files with 7152 additions and 7739 deletions
@@ -57,6 +57,9 @@ namespace Barotrauma
private readonly HashSet<Identifier> targetModuleTags = new HashSet<Identifier>();
[Serialize(true, IsPropertySaveable.Yes, description: "If false, we won't spawn another character if one with the same identifier has already been spawned.")]
public bool AllowDuplicates { get; set; }
[Serialize("", IsPropertySaveable.Yes, "What outpost module tags does the entity prefer to spawn in.")]
public string TargetModuleTags
{
@@ -115,6 +118,12 @@ namespace Barotrauma
HumanPrefab humanPrefab = NPCSet.Get(NPCSetIdentifier, NPCIdentifier);
if (humanPrefab != null)
{
if (!AllowDuplicates &&
Character.CharacterList.Any(c => c.Info?.HumanPrefabIds.NpcIdentifier == NPCIdentifier && c.Info?.HumanPrefabIds.NpcSetIdentifier == NPCSetIdentifier))
{
spawned = true;
return;
}
ISpatialEntity spawnPos = GetSpawnPos();
if (spawnPos != null)
{
@@ -145,6 +154,11 @@ namespace Barotrauma
}
else if (!SpeciesName.IsEmpty)
{
if (!AllowDuplicates && Character.CharacterList.Any(c => c.SpeciesName == SpeciesName))
{
spawned = true;
return;
}
ISpatialEntity spawnPos = GetSpawnPos();
if (spawnPos != null)
{