Fix bogus owner check in Lua API production code
This commit is contained in:
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
|
|
||||||
if (actionFunc != null)
|
if (actionFunc != null)
|
||||||
{
|
{
|
||||||
var playerIndex = Self.Owner.ClientIndex;
|
var player = Self.Owner;
|
||||||
var squadSize = actorTypes.Length;
|
var squadSize = actorTypes.Length;
|
||||||
var squad = new List<Actor>();
|
var squad = new List<Actor>();
|
||||||
var func = actionFunc.CopyReference() as LuaFunction;
|
var func = actionFunc.CopyReference() as LuaFunction;
|
||||||
@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
Action<Actor, Actor> productionHandler = (_, __) => { };
|
Action<Actor, Actor> productionHandler = (_, __) => { };
|
||||||
productionHandler = (factory, unit) =>
|
productionHandler = (factory, unit) =>
|
||||||
{
|
{
|
||||||
if (playerIndex != factory.Owner.ClientIndex)
|
if (player != factory.Owner)
|
||||||
{
|
{
|
||||||
triggers.OnProducedInternal -= productionHandler;
|
triggers.OnProducedInternal -= productionHandler;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user