fix: Cleans up LINQ calls. (#965)
- [X] Removes several `ToList()` uses with `PooledRefQueue` - [X] Adds a `PeekRandom` to PooledRefQueue - [X] Updates EV/BS so they dispel each other in a more efficient manner. - [X] Fixes Firebomb so it works like a normal firefield. - [X] Fixes field spells so they aren't unnecessarily using a Point3D ref more than necessary. - [X] Removes extra allocation in campfire by using reverse loop. - [X] Removes other LINQ calls that aren't needed.
This commit is contained in:
parent
daf89686d1
commit
23532db603
40 changed files with 585 additions and 447 deletions
|
|
@ -30,22 +30,21 @@ namespace Server.Spells.Fifth
|
|||
if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
var eastToWest = SpellHelper.GetEastToWest(Caster.Location, p);
|
||||
var loc = new Point3D(p);
|
||||
var eastToWest = SpellHelper.GetEastToWest(Caster.Location, loc);
|
||||
|
||||
Effects.PlaySound(new Point3D(p), Caster.Map, 0x20B);
|
||||
Effects.PlaySound(loc, Caster.Map, 0x20B);
|
||||
|
||||
var itemID = eastToWest ? 0x3915 : 0x3922;
|
||||
|
||||
var duration = TimeSpan.FromSeconds(3 + Caster.Skills.Magery.Fixed / 25);
|
||||
|
||||
for (var i = -2; i <= 2; ++i)
|
||||
{
|
||||
var loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);
|
||||
var targetLoc = new Point3D(eastToWest ? loc.X + i : loc.X, eastToWest ? loc.Y : loc.Y + i, loc.Z);
|
||||
|
||||
new InternalItem(itemID, loc, Caster, Caster.Map, duration, i);
|
||||
new InternalItem(itemID, targetLoc, Caster, Caster.Map, duration, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue