Cleanup and adds configuration for crashguard (#240)

This commit is contained in:
Kamron Batman 2020-09-12 01:57:07 -07:00 • committed by GitHub
parent 55ae0f8778
commit 7dbfa086bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1248 additions and 97 deletions

View file

@ -234,7 +234,7 @@ namespace Server.Items
base.CheckHold(m, item, false, checkItems, plusItems, plusWeight);
public override bool CheckContentDisplay(Mobile from) =>
RootParent is BaseCreature creature && creature.Controlled && creature.ControlMaster == @from ||
RootParent is BaseCreature creature && creature.Controlled && creature.ControlMaster == from ||
base.CheckContentDisplay(from);
public override void Serialize(IGenericWriter writer)

View file

@ -180,8 +180,8 @@ namespace Server.Items
if (item?.Deleted != false)
continue;
if (item is BaseArmor armor && Resmelt(@from, armor, armor.Resource) ||
item is BaseWeapon weapon && Resmelt(@from, weapon, weapon.Resource) ||
if (item is BaseArmor armor && Resmelt(from, armor, armor.Resource) ||
item is BaseWeapon weapon && Resmelt(from, weapon, weapon.Resource) ||
item is DragonBardingDeed)
salvaged++;
else

View file

@ -102,10 +102,10 @@ namespace Server.Items
}
public static bool ValidateDefault(Mobile from, BaseBoard board) =>
!board.Deleted && (from.AccessLevel >= AccessLevel.GameMaster || @from.Alive &&
(board.IsChildOf(@from.Backpack) || !(board.RootParent is Mobile) &&
board.Map == @from.Map && @from.InRange(board.GetWorldLocation(), 1) &&
BaseHouse.FindHouseAt(board)?.IsOwner(@from) == true));
!board.Deleted && (from.AccessLevel >= AccessLevel.GameMaster || from.Alive &&
(board.IsChildOf(from.Backpack) || !(board.RootParent is Mobile) &&
board.Map == from.Map && from.InRange(board.GetWorldLocation(), 1) &&
BaseHouse.FindHouseAt(board)?.IsOwner(from) == true));
public class DefaultEntry : ContextMenuEntry
{

View file

@ -71,7 +71,7 @@ namespace Server.Items
var contains = false;
if (house == null && m_BeforeChangeover ||
house?.IsOwner(@from) == true && (contains = house.Addons.Contains(this)))
house?.IsOwner(from) == true && (contains = house.Addons.Contains(this)))
{
Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
from.SendLocalizedMessage(500461); // You destroy the item.

View file

@ -69,7 +69,7 @@ namespace Server.Items
{
from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (from.Map == GetTargetMap() || @from.Map != Map.Trammel && @from.Map != Map.Felucca)
else if (from.Map == GetTargetMap() || from.Map != Map.Trammel && from.Map != Map.Felucca)
{
from.SendLocalizedMessage(1005401); // You cannot bury the stone here.
}

View file

@ -49,7 +49,7 @@ namespace Server.Items
{
var root = item.RootParent;
if (root != null && root != @from || item.Parent == from)
if (root != null && root != from || item.Parent == from)
{
message = "You decide that item's current location is too awkward to get an accurate result.";
}

View file

@ -157,8 +157,8 @@ namespace Server.Items
public virtual void BeginConfirmation(Mobile from)
{
if (IsInTown(@from.Location, @from.Map) && !IsInTown(Target, TargetMap) ||
@from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning)
if (IsInTown(from.Location, from.Map) && !IsInTown(Target, TargetMap) ||
from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning)
{
if (from.AccessLevel == AccessLevel.Player || !from.Hidden)
from.Send(new PlaySound(0x20E, from.Location));

View file

@ -188,8 +188,8 @@ namespace Server.Items
var toExplode = eable.Where(
o =>
{
if (!(o is Mobile mobile) || @from != null &&
(!SpellHelper.ValidIndirectTarget(@from, mobile) || !@from.CanBeHarmful(mobile, false)))
if (!(o is Mobile mobile) || from != null &&
(!SpellHelper.ValidIndirectTarget(from, mobile) || !from.CanBeHarmful(mobile, false)))
return o is BaseExplosionPotion && o != this;
++toDamage;

View file

@ -104,7 +104,7 @@ namespace Server.Items
m =>
{
if (from == m || !SpellHelper.ValidIndirectTarget(from, m) || !from.CanBeHarmful(m, false)
|| Core.AOS && !@from.InLOS(m))
|| Core.AOS && !from.InLOS(m))
return false;
if (m.Player)

View file

@ -111,7 +111,7 @@ namespace Server.Items
return;
}
if ((item.IsChildOf(from.Backpack) || Core.ML && item.Parent == @from) &&
if ((item.IsChildOf(from.Backpack) || Core.ML && item.Parent == from) &&
m_Powder.IsChildOf(from.Backpack))
{
var origMaxHP = wearable.MaxHitPoints;