Fix AI using SharedRandom values
The AI code runs on only one hosts, so by having the AI use SharedRandom values, the host's random gets out of sync with the other players' and crashes the game.
This commit is contained in:
@@ -116,7 +116,7 @@ namespace OpenRA.Mods.Common.AI
|
||||
|
||||
// Add a random factor so not every AI produces at the same tick early in the game.
|
||||
// Minimum should not be negative as delays in HackyAI could be zero.
|
||||
var randomFactor = world.SharedRandom.Next(0, ai.Info.StructureProductionRandomBonusDelay);
|
||||
var randomFactor = ai.Random.Next(0, ai.Info.StructureProductionRandomBonusDelay);
|
||||
waitTicks = active ? ai.Info.StructureProductionActiveDelay + randomFactor
|
||||
: ai.Info.StructureProductionInactiveDelay + randomFactor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user