From b30bae08c0d32e8fa1c80912af4a0269c7c1667b Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Mon, 9 Nov 2015 19:31:19 +0100 Subject: [PATCH] Fix bogus owner check in Lua API production code --- .../Scripting/Properties/ProductionProperties.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs index e1d7734798..52c5ab3670 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs @@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Scripting if (actionFunc != null) { - var playerIndex = Self.Owner.ClientIndex; + var player = Self.Owner; var squadSize = actorTypes.Length; var squad = new List(); var func = actionFunc.CopyReference() as LuaFunction; @@ -120,7 +120,7 @@ namespace OpenRA.Mods.Common.Scripting Action productionHandler = (_, __) => { }; productionHandler = (factory, unit) => { - if (playerIndex != factory.Owner.ClientIndex) + if (player != factory.Owner) { triggers.OnProducedInternal -= productionHandler; return;