(537240172) Fixed RuinGenerator using unsynced random when doing connections between ruin entities. I don't think there are any assemblies atm that use this type of connections, but if there were, the connections might've differed between clients/server.

This commit is contained in:
Joonas Rikkonen
2019-06-13 11:46:43 +03:00
parent 2b5e828716
commit 16359ea873
2 changed files with 71 additions and 9 deletions
@@ -1022,12 +1022,12 @@ namespace Barotrauma.RuinGeneration
{
targetEntity = ruinEntities.GetRandom(e =>
e.Room == targetRoom &&
e.Entity.prefab?.Identifier == connection.TargetEntityIdentifier)?.Entity;
e.Entity.prefab?.Identifier == connection.TargetEntityIdentifier, Rand.RandSync.Server)?.Entity;
}
}
else
{
targetEntity = ruinEntities.GetRandom(e => e.Entity.prefab?.Identifier == connection.TargetEntityIdentifier)?.Entity;
targetEntity = ruinEntities.GetRandom(e => e.Entity.prefab?.Identifier == connection.TargetEntityIdentifier, Rand.RandSync.Server)?.Entity;
}
if (targetEntity == null) continue;