fix: Cleanup IPoint3D calls (#704)

This commit is contained in:
Kamron Batman 2021-08-19 09:11:48 -07:00 • committed by GitHub
parent 788b04b958
commit 3293ffcf06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 158 additions and 264 deletions

View file

@ -121,7 +121,7 @@ namespace Server.Mobiles
{
activate = false;
}
else if (m.Map == null || m.Map == Map.Internal || !m.Map.GetSector(m).Active)
else if (m.Map == null || m.Map == Map.Internal || !m.Map.GetSector(m.Location).Active)
{
activate = false;
}
@ -3040,7 +3040,7 @@ namespace Server.Mobiles
if (m_Owner.m_Mobile.PlayerRangeSensitive) // have to check this in the timer....
{
var sect = m_Owner.m_Mobile.Map.GetSector(m_Owner.m_Mobile);
var sect = m_Owner.m_Mobile.Map.GetSector(m_Owner.m_Mobile.Location);
if (!sect.Active)
{
m_Owner.Deactivate();

View file

@ -887,15 +887,13 @@ namespace Server.Mobiles
public virtual bool CanBreath => HasBreath && !Summoned;
public virtual bool IsDispellable => Summoned && !IsAnimatedDead;
public virtual bool
PlayerRangeSensitive // If they are following a waypoint, they'll continue to follow it even if players aren't around
=> CurrentWayPoint == null;
// If they are following a waypoint, they'll continue to follow it even if players aren't around
public virtual bool PlayerRangeSensitive => CurrentWayPoint == null;
public virtual bool ReturnsToHome =>
SeeksHome && Home != Point3D.Zero && !m_ReturnQueued && !Controlled && !Summoned;
// used for deleting untamed creatures [in houses]
[CommandProperty(AccessLevel.GameMaster)]
public bool RemoveIfUntamed { get; set; }
@ -3895,16 +3893,13 @@ namespace Server.Mobiles
public void GoHome_Callback()
{
if (m_ReturnQueued && IsSpawnerBound())
if (m_ReturnQueued && IsSpawnerBound() && !Map.GetSector(X, Y).Active)
{
SetLocation(Home, true);
if (!Map.GetSector(X, Y).Active)
{
SetLocation(Home, true);
if (!Map.GetSector(X, Y).Active)
{
AIObject?.Deactivate();
}
AIObject?.Deactivate();
}
}

View file

@ -968,7 +968,7 @@ namespace Server.Mobiles
public bool CanInteractWith(Mobile from, bool ownerOnly)
{
if (!from.CanSee(this) || !Utility.InUpdateRange(from, this) || !from.CheckAlive())
if (!from.CanSee(this) || !Utility.InUpdateRange(from.Location, Location) || !from.CheckAlive())
{
return false;
}
@ -1184,7 +1184,7 @@ namespace Server.Mobiles
return false;
}
if (House.IsInside(to) || to.Map != House.Map || !House.InRange(to, 5))
if (House.IsInside(to) || to.Map != House.Map || !House.InRange(to.Location, 5))
{
return false;
}