public static void EventSink_Logout(Mobile from) { Party p = Get(from); p?.Remove(from); from.Party = null; }
public static void EventSink_Logout(LogoutEventArgs e) { Mobile from = e.Mobile; Party p = Get(from); p?.Remove(from); from.Party = null; }
public static void EventSink_Logout(Mobile from) { Party p = Party.Get(from); if (p != null) { p.Remove(from); } from.Party = null; }
public static void EventSink_Logout(LogoutEventArgs e) { Mobile from = e.Mobile; Party p = Party.Get(from); if (p != null) { p.Remove(from); } from.Party = null; }
public override void OnRemove(Mobile from, Mobile target) { Party p = Party.Get(from); if (p == null) { from.SendLocalizedMessage(3000211); // You are not in a party. return; } if (p.Leader == from && target == null) { from.SendLocalizedMessage(1005455); // Who would you like to remove from your party? from.Target = new RemovePartyTarget(); } else if ((p.Leader == from || from == target) && p.Contains(target)) { p.Remove(target); } }
protected override void OnTarget(Mobile from, object o) { if (o is Mobile m) { Party p = Party.Get(from); if (p == null || p.Leader != from || !p.Contains(m)) { return; } if (from == m) { from.SendLocalizedMessage(1005446); // You may only remove yourself from a party if you are not the leader. } else { p.Remove(m); } } }