fix: Consolidates and fixes movement/direction checks (#1861)
This commit is contained in:
parent
06e05f2e52
commit
e6bfc45228
11 changed files with 146 additions and 320 deletions
|
|
@ -3836,24 +3836,27 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
// return root == null ? m_Location : new Point3D( (IPoint3D) root );
|
||||
}
|
||||
|
||||
public Point3D GetSurfaceTop()
|
||||
public IPoint3D GetSurfaceTop()
|
||||
{
|
||||
var root = RootParent;
|
||||
|
||||
if (root == null)
|
||||
{
|
||||
return new Point3D(
|
||||
m_Location.m_X,
|
||||
m_Location.m_Y,
|
||||
m_Location.m_Z + (ItemData.Surface ? ItemData.CalcHeight : 0)
|
||||
);
|
||||
}
|
||||
|
||||
return root.Location;
|
||||
return (root as Item)?.GetSurfaceTop() ?? (ItemData.Surface ? new Point3D(
|
||||
m_Location.m_X,
|
||||
m_Location.m_Y,
|
||||
m_Location.m_Z + ItemData.CalcHeight
|
||||
) : this);
|
||||
}
|
||||
|
||||
public Point3D GetWorldTop() => RootParent?.Location ??
|
||||
new Point3D(m_Location.m_X, m_Location.m_Y, m_Location.m_Z + ItemData.CalcHeight);
|
||||
public Point3D GetWorldTop()
|
||||
{
|
||||
var root = RootParent;
|
||||
|
||||
return (root as Item)?.GetWorldTop() ?? new Point3D(
|
||||
m_Location.m_X,
|
||||
m_Location.m_Y,
|
||||
m_Location.m_Z + ItemData.CalcHeight
|
||||
);
|
||||
}
|
||||
|
||||
public void SendLocalizedMessageTo(Mobile to, int number, string args = "")
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue