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
|
|
@ -95,7 +95,7 @@ namespace Server
|
|||
foreach (var m in eable)
|
||||
{
|
||||
if (from.CanBeHarmful(m, false) &&
|
||||
m.InLOS(new Point3D(origin, origin.Z + 1)) &&
|
||||
m.InLOS(new Point3D(origin.X, origin.Y, origin.Z + 1)) &&
|
||||
Faction.Find(m) != null)
|
||||
{
|
||||
targets.Add(from);
|
||||
|
|
@ -118,7 +118,7 @@ namespace Server
|
|||
}
|
||||
|
||||
Effects.SendMovingEffect(
|
||||
new Entity(Serial.Zero, new Point3D(origin, origin.Z + 4), facet),
|
||||
new Entity(Serial.Zero, new Point3D(origin.X, origin.Y, origin.Z + 4), facet),
|
||||
mob,
|
||||
14068,
|
||||
1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue