Removes implicit this.

This commit is contained in:
Kamron Batman 2018-09-14 12:56:58 -07:00
parent 04b4cfe75b
commit 83dcf536d8
533 changed files with 2804 additions and 2806 deletions

View file

@ -60,7 +60,7 @@ namespace Server
return 0;
if ( phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0 )
Mobiles.MeerMage.StopEffect( m, true );
MeerMage.StopEffect( m, true );
if ( !Core.AOS )
{

View file

@ -68,14 +68,14 @@ namespace Server.Misc
if ( WarningDelay > TimeSpan.Zero )
{
Warning_Callback();
Timer.DelayCall( WarningDelay, WarningDelay, new TimerCallback( Warning_Callback ) );
DelayCall( WarningDelay, WarningDelay, new TimerCallback( Warning_Callback ) );
}
AutoSave.Save();
m_Restarting = true;
Timer.DelayCall( RestartDelay, new TimerCallback( Restart_Callback ) );
DelayCall( RestartDelay, new TimerCallback( Restart_Callback ) );
}
}
}

View file

@ -66,13 +66,13 @@ namespace Server.Misc
else
World.Broadcast( 0x35, true, "The world will save in {0} second{1}.", s, s != 1 ? "s" : "" );
Timer.DelayCall( m_Warning, new TimerCallback( Save ) );
DelayCall( m_Warning, new TimerCallback( Save ) );
}
}
public static void Save()
{
AutoSave.Save( false );
Save( false );
}
public static void Save( bool permitBackgroundWrite )

View file

@ -231,7 +231,7 @@ namespace Server
{
bool hasArgs = (args != null);
this.EnsureCapacity( (hasArgs ? (48 + args.ToString().Length * 2): 44) );
EnsureCapacity( (hasArgs ? (48 + args.ToString().Length * 2): 44) );
m_Stream.Write( (int)mob.Serial );
@ -284,7 +284,7 @@ namespace Server
public RemoveBuffPacket( Mobile mob, BuffIcon iconID )
: base( 0xDF )
{
this.EnsureCapacity( 13 );
EnsureCapacity( 13 );
m_Stream.Write( (int)mob.Serial );
m_Stream.Write( (short)iconID ); //ID

View file

@ -724,7 +724,7 @@ namespace Server.Misc
{
m_Mobile = m;
m_Message = message;
this.Start();
Start();
}
protected override void OnTick()

View file

@ -125,7 +125,7 @@ namespace Server.Misc
if ( item is Fists )
return false;
if ( item is ICommodity || item is Multis.BaseBoat
if ( item is ICommodity || item is BaseBoat
|| item is Fish || item is BigFish
|| item is BasePotion || item is Food || item is CookableFood
|| item is SpecialFishingNet || item is BaseMagicFish

View file

@ -80,7 +80,7 @@ namespace Server
this.type = type;
this.method = method;
this.parms = method.GetParameters();
parms = method.GetParameters();
}
}
@ -479,7 +479,7 @@ namespace Server
public bool CompareTo( int sign, Callback argGenerator )
{
Type active = this.Active;
Type active = Active;
MethodInfo compareTo = active.GetMethod( "CompareTo", new[] { active } );

View file

@ -26,10 +26,10 @@ namespace Server.Items
public bool CouldFit( IPoint3D p, Map map )
{
if ( !map.CanFit( p.X, p.Y, p.Z, this.ItemData.Height ) )
if ( !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
return false;
if ( this.ItemID == 0x2375 )
if ( ItemID == 0x2375 )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
else
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
@ -53,28 +53,28 @@ namespace Server.Items
private void FixMovingCrate()
{
if ( this.Deleted )
if ( Deleted )
return;
if ( this.Movable || this.IsLockedDown )
if ( Movable || IsLockedDown )
{
Item deed = this.Deed;
Item deed = Deed;
if ( this.Parent is Item item )
if ( Parent is Item item )
{
item.AddItem( deed );
deed.Location = this.Location;
deed.Location = Location;
}
else
{
deed.MoveToWorld( this.Location, this.Map );
deed.MoveToWorld( Location, Map );
}
Delete();
}
}
public Item Deed => new MistletoeDeed( this.Hue );
public Item Deed => new MistletoeDeed( Hue );
public override void OnDoubleClick( Mobile from )
{
@ -82,7 +82,7 @@ namespace Server.Items
if ( house != null && house.IsCoOwner( from ) )
{
if ( from.InRange( this.GetWorldLocation(), 3 ) )
if ( from.InRange( GetWorldLocation(), 3 ) )
{
from.CloseGump( typeof( MistletoeAddonGump ) );
from.SendGump( new MistletoeAddonGump( from, this ) );
@ -283,7 +283,7 @@ namespace Server.Items
if ( itemID > 0 )
{
Item addon = new MistletoeAddon( this.Hue );
Item addon = new MistletoeAddon( Hue );
addon.ItemID = itemID;
addon.MoveToWorld( loc, from.Map );

View file

@ -200,7 +200,7 @@ namespace Server.Guilds
if ( g.Alliance != this || !m_PendingMembers.Contains( g ) || m_Members.Contains( g ) )
return;
g.GuildMessage( 1070760, this.Name ); // Your Guild has joined the ~1_ALLIANCENAME~ Alliance.
g.GuildMessage( 1070760, Name ); // Your Guild has joined the ~1_ALLIANCENAME~ Alliance.
AllianceMessage( 1070761, g.Name ); // A new Guild has joined your Alliance: ~1_GUILDNAME~
m_PendingMembers.Remove( g );
@ -220,7 +220,7 @@ namespace Server.Guilds
m_Members.Remove( g );
g.InvalidateMemberProperties();
g.GuildMessage( 1070763, this.Name ); // Your Guild has been removed from the ~1_ALLIANCENAME~ Alliance.
g.GuildMessage( 1070763, Name ); // Your Guild has been removed from the ~1_ALLIANCENAME~ Alliance.
AllianceMessage( 1070764, g.Name ); // A Guild has left your Alliance: ~1_GUILDNAME~
}
@ -555,7 +555,7 @@ namespace Server.Guilds
protected override void OnTick()
{
foreach( Guild g in Guild.List.Values )
foreach( Guild g in BaseGuild.List.Values )
g.CheckExpiredWars();
}
}
@ -685,7 +685,7 @@ namespace Server.Guilds
}
set
{
AllianceInfo current = this.Alliance;
AllianceInfo current = Alliance;
if ( value == current )
return;
@ -778,7 +778,7 @@ namespace Server.Guilds
if ( status != WarStatus.InProgress )
{
AllianceInfo myAlliance = this.Alliance;
AllianceInfo myAlliance = Alliance;
bool inAlliance = myAlliance?.IsMember( this ) == true;
AllianceInfo otherAlliance = g?.Alliance;
@ -795,7 +795,7 @@ namespace Server.Guilds
InvalidateMemberProperties();
}
this.AcceptedWars.Remove( w );
AcceptedWars.Remove( w );
if ( g != null )
{
@ -804,12 +804,12 @@ namespace Server.Guilds
if ( otherInAlliance )
{
otherAlliance.AllianceMessage( 1070739 + (int)status, ( inAlliance ? this.Alliance.Name : this.Name ) );
otherAlliance.AllianceMessage( 1070739 + (int)status, ( inAlliance ? Alliance.Name : Name ) );
otherAlliance.InvalidateMemberProperties();
}
else
{
g.GuildMessage( 1070739 + (int)status, (inAlliance ? this.Alliance.Name : this.Name) );
g.GuildMessage( 1070739 + (int)status, (inAlliance ? Alliance.Name : Name) );
g.InvalidateMemberProperties();
}
@ -826,7 +826,7 @@ namespace Server.Guilds
if ( w.Status != WarStatus.Pending )
{
//All sanity in here
this.PendingWars.Remove( w );
PendingWars.Remove( w );
g?.PendingWars.Remove( g.FindPendingWar( this ) );
}
@ -995,7 +995,7 @@ namespace Server.Guilds
set
{
if ( value != null )
this.AddMember( value ); //Also removes from old guild.
AddMember( value ); //Also removes from old guild.
if ( m_Leader is PlayerMobile leader && leader?.Guild == this )
leader.GuildRank = RankDefinition.Member;
@ -1020,7 +1020,7 @@ namespace Server.Guilds
{
m_Leader = null;
BaseGuild.List.Remove( this.Id );
List.Remove( Id );
foreach ( Mobile m in m_Members )
{
@ -1099,8 +1099,8 @@ namespace Server.Guilds
#region Serialization
public override void Serialize( GenericWriter writer )
{
if ( this.LastFealty+TimeSpan.FromDays( 1.0 ) < DateTime.UtcNow )
this.CalculateGuildmaster();
if ( LastFealty+TimeSpan.FromDays( 1.0 ) < DateTime.UtcNow )
CalculateGuildmaster();
CheckExpiredWars();
@ -1283,14 +1283,14 @@ namespace Server.Guilds
CheckExpiredWars();
AllianceInfo alliance = this.Alliance;
AllianceInfo alliance = Alliance;
alliance?.CheckLeader();
alliance = this.Alliance; //CheckLeader could possibly change the value of this.Alliance
alliance = Alliance; //CheckLeader could possibly change the value of this.Alliance
if ( alliance != null && !alliance.IsMember( this ) && !alliance.IsPendingMember( this ) ) //This block is there to fix a bug in the code in an older version.
this.Alliance = null; //Will call Alliance.RemoveGuild which will set it null & perform all the pertient checks as far as alliacne disbanding
Alliance = null; //Will call Alliance.RemoveGuild which will set it null & perform all the pertient checks as far as alliacne disbanding
}

View file

@ -69,7 +69,7 @@ namespace Server
int hours, minutes;
Server.Items.Clock.GetTime( from.Map, from.X, from.Y, out hours, out minutes );
Items.Clock.GetTime( from.Map, from.X, from.Y, out hours, out minutes );
/* OSI times:
*

View file

@ -75,7 +75,7 @@ namespace Server
{
checkLuck = false;
if ( LootPack.CheckLuck( luckChance ) )
if ( CheckLuck( luckChance ) )
shouldAdd = ( entry.Chance > Utility.Random( 10000 ) );
}

View file

@ -98,10 +98,10 @@ namespace Server.Misc
if ( (pmFrom?.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg?.DuelContext != null && pmTarg.DuelContext.Started) )
return false;
if ( from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
if ( from.Region.GetRegion( typeof( SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
return false;
sz = target.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
sz = target.Region.GetRegion( typeof( SafeZone ) ) as SafeZone;
if ( sz != null /*&& sz.IsDisabled()*/ )
return false;
@ -172,10 +172,10 @@ namespace Server.Misc
if ( (pmFrom?.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg?.DuelContext != null && pmTarg.DuelContext.Started) )
return false;
if ( from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
if ( from.Region.GetRegion( typeof( SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
return false;
sz = target.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
sz = target.Region.GetRegion( typeof( SafeZone ) ) as SafeZone;
if ( sz != null /*&& sz.IsDisabled()*/ )
return false;
@ -388,7 +388,7 @@ namespace Server.Misc
if ( bcTarg?.InitialInnocent != true )
{
if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( bcTarg ) && pmTarg == null || !Core.ML && !target.CanBeginAction( typeof( Server.Spells.Seventh.PolymorphSpell ) ) )
if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( bcTarg ) && pmTarg == null || !Core.ML && !target.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
return Notoriety.CanBeAttacked;
}

View file

@ -172,7 +172,7 @@ namespace Server.Misc
private static IPAddress FindPublicAddress()
{
try {
WebRequest req = HttpWebRequest.Create( "https://api.ipify.org" );
WebRequest req = WebRequest.Create( "https://api.ipify.org" );
req.Timeout = 15000;

View file

@ -8,7 +8,7 @@ namespace Server
{
private const int Range = 5; // No house may be placed within 5 tiles of the treasure
public TreasureRegion( int x, int y, Map map ): base( null, map, Region.DefaultPriority, new Rectangle2D( x - Range, y - Range, 1 + (Range * 2), 1 + (Range * 2) ) )
public TreasureRegion( int x, int y, Map map ): base( null, map, DefaultPriority, new Rectangle2D( x - Range, y - Range, 1 + (Range * 2), 1 + (Range * 2) ) )
{
GoLocation = new Point3D( x, y, map.GetAverageZ( x, y ) );

View file

@ -10,7 +10,7 @@ namespace Server
{
public static void Initialize()
{
CommandSystem.Register( "VendorGen", AccessLevel.Administrator, new CommandEventHandler( VendorGenerator.VendorGen_OnCommand ) );
CommandSystem.Register( "VendorGen", AccessLevel.Administrator, new CommandEventHandler( VendorGen_OnCommand ) );
}
private static Rectangle2D[] m_BritRegions = new[]