From 635038aa0b68ea26b3ddd6a0a01c6bf85d4437ce Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 17 Jan 2019 21:38:09 +0000 Subject: [PATCH] Disable bot logic during replays. --- OpenRA.Mods.Common/Traits/Player/ModularBot.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Player/ModularBot.cs b/OpenRA.Mods.Common/Traits/Player/ModularBot.cs index 0ab6fe8f45..a1f0da109b 100644 --- a/OpenRA.Mods.Common/Traits/Player/ModularBot.cs +++ b/OpenRA.Mods.Common/Traits/Player/ModularBot.cs @@ -63,6 +63,11 @@ namespace OpenRA.Mods.Common.Traits // Called by the host's player creation code public void Activate(Player p) { + // Bot logic is not allowed to affect world state, and can only act by issuing orders + // These orders are recorded in the replay, so bots shouldn't be enabled during replays + if (p.World.IsReplay) + return; + IsEnabled = true; player = p; tickModules = p.PlayerActor.TraitsImplementing().ToArray();