Add a proper exception when creating an actor with an invalid owner in Lua

This commit is contained in:
abcdefg30
2018-10-05 00:33:07 +02:00
committed by Mustafa Alperen Seki
parent 38e8bed9c9
commit 00dc161628

View File

@@ -56,6 +56,10 @@ namespace OpenRA.Mods.Common.Scripting
}
}
var owner = initDict.GetOrDefault<OwnerInit>();
if (owner == null)
throw new LuaException("Tried to create actor '{0}' with an invalid or no owner init!".F(type));
// The actor must be added to the world at the end of the tick
var a = Context.World.CreateActor(false, type, initDict);
if (addToWorld)