## **MAJOR CHANGE** * `Stabled` has been moved to `PlayerMobile`. * New methods added, `PlayerMobile.AddStabled` and `PlayerMobile.RemoveStabled`. * Added `PlayerMobile.AddFollower` and `PlayerMobile.RemoveFollower`. * `Stabled`, `AutoStabled`, and `AllFollowers` are now `HashSet` and **_CAN BE NULL_**. ### Summary * Fixes monster abilities causing harm to the monster through reflect * Adds `CanTriggerAgainstSelf` to override this for healing or some other self-affecting ability * Fixes a major memory leak where `UnsummonTimer` from animated dead spell lasts up-to 24hrs and therefore holds onto references of dead/deleted mobs. * Fixes another minor leak where a mob is not unregistered from the animated dead spell list until the next spell cast.
18 lines
493 B
C#
18 lines
493 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Server;
|
|
|
|
public partial class Mobile
|
|
{
|
|
// Migrating Stabled property to PlayerMobile
|
|
public static Dictionary<Mobile, HashSet<Mobile>> StableMigrations { get; private set; }
|
|
|
|
public static void AddToStabledMigration(Mobile m, HashSet<Mobile> stabled)
|
|
{
|
|
if (stabled?.Count > 0)
|
|
{
|
|
StableMigrations ??= new Dictionary<Mobile, HashSet<Mobile>>();
|
|
StableMigrations[m] = stabled;
|
|
}
|
|
}
|
|
}
|