fix: Adds CanSeeStaffOnly for staff only items (#739)
This commit is contained in:
parent
862e868cf0
commit
3bfd5c4d3e
4 changed files with 15 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -308,12 +308,13 @@ namespace Server.Engines.Spawners
|
|||
DoTimer(TimeSpan.FromSeconds(1));
|
||||
}
|
||||
|
||||
public override bool CanSeeStaffOnly(Mobile from) => from.AccessLevel >= AccessLevel.Developer;
|
||||
|
||||
public override bool IsAccessibleTo(Mobile from) => from.AccessLevel >= AccessLevel.Developer;
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.AccessLevel >= AccessLevel.Developer)
|
||||
{
|
||||
from.SendGump(new SpawnerGump(this));
|
||||
}
|
||||
from.SendGump(new SpawnerGump(this));
|
||||
}
|
||||
|
||||
public virtual void GetSpawnerProperties(ObjectPropertyList list)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue