Fixes parent references. (#15)

This commit is contained in:
Kamron Batman 2019-03-03 15:40:17 -08:00 committed by GitHub
parent 01d0fb75b8
commit 90ffe0ea3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 55 additions and 93 deletions

View file

@ -47,15 +47,12 @@ namespace Server.Items
public bool Validate()
{
object root = RootParent;
if (!(RootParent is Mobile mobile) || mobile.AccessLevel >= AccessLevel)
return true;
if (root is Mobile mobile && mobile.AccessLevel < AccessLevel)
{
Delete();
return false;
}
Delete();
return false;
return true;
}
public override void OnSingleClick(Mobile from)
@ -83,4 +80,4 @@ namespace Server.Items
return from.AccessLevel >= AccessLevel;
}
}
}
}