fix: Cleans up Point checks and removes statics (#966)
- [X] Removes static freezing/unfreezing. Use other tools for this. - [X] Cleans up IPoint3D allocations - [X] Removes IPoint3D constructors since the compiler may not optimize the constructor path and allow allocations. Note: Instead of `new Point3D(m)`, do something like `new Point3D(m.Location)`. Sorry for the inconvenience. In the long run this will prevent abuse of hot paths that will cause performance issues.
This commit is contained in:
parent
23532db603
commit
0925a2d435
18 changed files with 184 additions and 958 deletions
|
|
@ -155,9 +155,7 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
var m = m_Mobile;
|
||||
|
||||
if (m.Location != m_Teleporter.Location || m.Map != m_Teleporter.Map)
|
||||
if (m_Mobile.Location != m_Teleporter.Location || m_Mobile.Map != m_Teleporter.Map)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -165,11 +163,11 @@ namespace Server.Items
|
|||
var p = target.GetWorldTop();
|
||||
var map = target.Map;
|
||||
|
||||
BaseCreature.TeleportPets(m, p, map);
|
||||
BaseCreature.TeleportPets(m_Mobile, p, map);
|
||||
|
||||
m.MoveToWorld(p, map);
|
||||
m_Mobile.MoveToWorld(p, map);
|
||||
|
||||
if (m.Hidden && m.AccessLevel != AccessLevel.Player)
|
||||
if (m_Mobile.Hidden && m_Mobile.AccessLevel != AccessLevel.Player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue