Disable bot logic during replays.

This commit is contained in:
Paul Chote
2019-01-17 21:38:09 +00:00
parent 531560c41e
commit 635038aa0b

View File

@@ -63,6 +63,11 @@ namespace OpenRA.Mods.Common.Traits
// Called by the host's player creation code // Called by the host's player creation code
public void Activate(Player p) 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; IsEnabled = true;
player = p; player = p;
tickModules = p.PlayerActor.TraitsImplementing<IBotTick>().ToArray(); tickModules = p.PlayerActor.TraitsImplementing<IBotTick>().ToArray();