Throw a lua exception when setting an owner to null/nil
This commit is contained in:
@@ -60,6 +60,9 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (value == null)
|
||||||
|
throw new LuaException("Attempted to change the owner of actor '{0}' to nil value.".F(Self));
|
||||||
|
|
||||||
if (Self.Owner != value)
|
if (Self.Owner != value)
|
||||||
Self.ChangeOwner(value);
|
Self.ChangeOwner(value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user