fix: Changes Map.Sector.Mobiles to link list & Fixes various related crash bugs (#1553)
### Summary
Eliminates `IPooledEnumerable<T>` and `eable.Free()` from `Map` for mobiles. This drastically simplifies code that iterates in range, for example:
```cs
foreach (var m in m.GetMobilesInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.
- [X] Fixed several locations where an NPC that was damaged would cause a server crash.
- [X] Removed an unnecessary allocation in guard fake calls (NPCs calling guards on you)
- [X] Fixes damage precision loss in Poison Strike Spell
- [X] BogThing no longer attempts to "search" for boglings to eat when it is at full health
This commit is contained in:
parent
27f0cec1fa
commit
28c06c1cc0
71 changed files with 796 additions and 591 deletions
|
|
@ -114,8 +114,7 @@ namespace Server.Spells.Spellweaving
|
|||
private bool CheckArcanists()
|
||||
{
|
||||
var spellWeaving = Caster.Skills.Spellweaving.Value;
|
||||
var eable = Caster.GetMobilesInRange(1);
|
||||
foreach (var m in eable)
|
||||
foreach (var m in Caster.GetMobilesInRange(1))
|
||||
{
|
||||
if (m != Caster && m is PlayerMobile && Caster.CanBeBeneficial(m, false) &&
|
||||
Math.Abs(spellWeaving - m.Skills.Spellweaving.Value) <= 20)
|
||||
|
|
@ -132,9 +131,7 @@ namespace Server.Spells.Spellweaving
|
|||
// Everyone gets the Arcane Focus, power capped elsewhere
|
||||
|
||||
var pool = PooledRefQueue<Mobile>.Create();
|
||||
var eable = Caster.GetMobilesInRange(1);
|
||||
|
||||
foreach (var m in eable)
|
||||
foreach (var m in Caster.GetMobilesInRange(1))
|
||||
{
|
||||
if (m != Caster && m is PlayerMobile && Caster.CanBeBeneficial(m, false) &&
|
||||
Math.Abs(spellWeaving - m.Skills.Spellweaving.Value) <= 20)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue