fix: Adds CanSeeStaffOnly for staff only items (#739)

This commit is contained in:
Kamron Batman 2021-08-27 19:12:32 -07:00 • committed by GitHub
parent 862e868cf0
commit 3bfd5c4d3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 19 deletions

View file

@ -408,6 +408,8 @@ namespace Server
public virtual bool IsVirtualItem => false;
public virtual bool CanSeeStaffOnly(Mobile from) => from.AccessLevel > AccessLevel.Counselor;
public virtual int LabelNumber
{
get

View file

@ -1238,9 +1238,7 @@ namespace Server
if (org.X > dest.X || org.X == dest.X && org.Y > dest.Y || org.X == dest.X && org.Y == dest.Y && org.Z > dest.Z)
{
var swap = org;
org = dest;
dest = swap;
(org, dest) = (dest, org);
}
int height;

View file

@ -5195,7 +5195,7 @@ namespace Server
var map = from.Map;
if (DragEffects && map != null && (root == null || root is Item))
if (DragEffects && map != null && root is null or Item)
{
var eable = map.GetClientsInRange(from.Location);
var rootItem = root as Item;
@ -7181,17 +7181,12 @@ namespace Server
public virtual bool CanSee(object o)
{
if (o is Item item)
return o switch
{
return CanSee(item);
}
if (o is Mobile mobile)
{
return CanSee(mobile);
}
return true;
Item item => CanSee(item),
Mobile mobile => CanSee(mobile),
_ => true
};
}
public virtual bool CanSee(Item item)
@ -7239,7 +7234,7 @@ namespace Server
}
}
return !item.Deleted && item.Map == m_Map && (item.Visible || m_AccessLevel > AccessLevel.Counselor);
return !item.Deleted && item.Map == m_Map && (item.Visible || item.CanSeeStaffOnly(this));
}
public virtual bool CanSee(Mobile m)