Add a proper exception when creating an actor with an invalid owner in Lua
This commit is contained in:
committed by
Mustafa Alperen Seki
parent
38e8bed9c9
commit
00dc161628
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user