Throw a lua exception when setting an owner to null/nil

This commit is contained in:
abcdefg30
2019-09-30 20:59:00 +02:00
committed by reaperrr
parent 988d6079e3
commit fdd3bffa1d

View File

@@ -60,6 +60,9 @@ namespace OpenRA.Mods.Common.Scripting
set
{
if (value == null)
throw new LuaException("Attempted to change the owner of actor '{0}' to nil value.".F(Self));
if (Self.Owner != value)
Self.ChangeOwner(value);
}