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

@ -150,7 +150,7 @@ namespace Server.Multis
{
get
{
DecayType type = this.DecayType;
DecayType type = DecayType;
return ( type == DecayType.Condemned || type == DecayType.ManualRefresh );
}
@ -228,7 +228,7 @@ namespace Server.Multis
if ( DecayType == DecayType.Condemned )
return false;
DecayLevel oldLevel = this.DecayLevel;
DecayLevel oldLevel = DecayLevel;
m_LastRefreshed = DateTime.UtcNow;
@ -243,7 +243,7 @@ namespace Server.Multis
public virtual bool CheckDecay()
{
if ( !Deleted && this.DecayLevel == DecayLevel.Collapsed )
if ( !Deleted && DecayLevel == DecayLevel.Collapsed )
{
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Decay_Sandbox ) );
return true;
@ -729,7 +729,7 @@ namespace Server.Multis
{
foreach ( IEntity entity in GetHouseEntities() )
{
Point3D relLoc = new Point3D( entity.X - this.X, entity.Y - this.Y, entity.Z - this.Z );
Point3D relLoc = new Point3D( entity.X - X, entity.Y - Y, entity.Z - Z );
RelocatedEntity relocEntity = new RelocatedEntity( entity, relLoc );
RelocatedEntities.Add( relocEntity );
@ -746,7 +746,7 @@ namespace Server.Multis
foreach ( RelocatedEntity relocEntity in RelocatedEntities )
{
Point3D relLoc = relocEntity.RelativeLocation;
Point3D location = new Point3D( relLoc.X + this.X, relLoc.Y + this.Y, relLoc.Z + this.Z );
Point3D location = new Point3D( relLoc.X + X, relLoc.Y + Y, relLoc.Z + Z );
IEntity entity = relocEntity.Entity;
if ( entity is Item )
@ -757,9 +757,9 @@ namespace Server.Multis
{
if ( item is IAddon )
{
if ( ((IAddon)item).CouldFit( location, this.Map ) )
if ( ((IAddon)item).CouldFit( location, Map ) )
{
item.MoveToWorld( location, this.Map );
item.MoveToWorld( location, Map );
continue;
}
}
@ -778,9 +778,9 @@ namespace Server.Multis
requireSurface = false;
}
if ( this.Map.CanFit( location.X, location.Y, location.Z, height, false, false, requireSurface ) )
if ( Map.CanFit( location.X, location.Y, location.Z, height, false, false, requireSurface ) )
{
item.MoveToWorld( location, this.Map );
item.MoveToWorld( location, Map );
continue;
}
}
@ -867,9 +867,9 @@ namespace Server.Multis
if ( !mobile.Deleted )
{
if ( this.Map.CanFit( location, 16, false, false ) )
if ( Map.CanFit( location, 16, false, false ) )
{
mobile.MoveToWorld( location, this.Map );
mobile.MoveToWorld( location, Map );
}
else
{
@ -892,16 +892,16 @@ namespace Server.Multis
public List<Item> GetItems()
{
if ( this.Map == null || this.Map == Map.Internal )
if ( Map == null || Map == Map.Internal )
return new List<Item>();
Point2D start = new Point2D( this.X + Components.Min.X, this.Y + Components.Min.Y );
Point2D end = new Point2D( this.X + Components.Max.X + 1, this.Y + Components.Max.Y + 1 );
Point2D start = new Point2D( X + Components.Min.X, Y + Components.Min.Y );
Point2D end = new Point2D( X + Components.Max.X + 1, Y + Components.Max.Y + 1 );
Rectangle2D rect = new Rectangle2D( start, end );
List<Item> list = new List<Item>();
IPooledEnumerable<Item> eable = this.Map.GetItemsInBounds( rect );
IPooledEnumerable<Item> eable = Map.GetItemsInBounds( rect );
foreach ( Item item in eable )
if ( item.Movable && IsInside( item ) )
@ -914,7 +914,7 @@ namespace Server.Multis
public List<Mobile> GetMobiles()
{
if ( this.Map == null || this.Map == Map.Internal )
if ( Map == null || Map == Map.Internal )
return new List<Mobile>();
List<Mobile> list = new List<Mobile>();
@ -940,8 +940,8 @@ namespace Server.Multis
public static void Configure()
{
Item.LockedDownFlag = 1;
Item.SecureFlag = 2;
LockedDownFlag = 1;
SecureFlag = 2;
Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), new TimerCallback( Decay_OnTick ) );
}
@ -1084,7 +1084,7 @@ namespace Server.Multis
public bool IsInside( Mobile m )
{
if ( m == null || m.Deleted || m.Map != this.Map )
if ( m == null || m.Deleted || m.Map != Map )
return false;
return IsInside( m.Location, 16 );
@ -1092,7 +1092,7 @@ namespace Server.Multis
public bool IsInside( Item item )
{
if ( item == null || item.Deleted || item.Map != this.Map )
if ( item == null || item.Deleted || item.Map != Map )
return false;
return IsInside( item.Location, item.ItemData.Height );
@ -1160,7 +1160,7 @@ namespace Server.Multis
if ( x < 0 || x >= mcl.Width || y < 0 || y >= mcl.Height )
return false;
if ( this is HouseFoundation && y < (mcl.Height-1) && p.Z >= this.Z )
if ( this is HouseFoundation && y < (mcl.Height-1) && p.Z >= Z )
return true;
StaticTile[] tiles = mcl.Tiles[x][y];
@ -1179,7 +1179,7 @@ namespace Server.Multis
if ( (id >= 0xB95 && id <= 0xC0E) || (id >= 0xC43 && id <= 0xC44) )
continue;
int tileZ = tile.Z + this.Z;
int tileZ = tile.Z + Z;
if ( p.Z == tileZ || (p.Z + height) > tileZ )
return true;
@ -1235,7 +1235,7 @@ namespace Server.Multis
m_MaxLockDowns = MaxLockDown;
m_MaxSecures = MaxSecure;
m_RelativeBanLocation = this.BaseBanLocation;
m_RelativeBanLocation = BaseBanLocation;
UpdateRegion();
@ -1265,20 +1265,20 @@ namespace Server.Multis
UpdateRegion();
if ( m_Sign != null && !m_Sign.Deleted )
m_Sign.Map = this.Map;
m_Sign.Map = Map;
if ( m_Doors != null )
{
foreach ( Item item in m_Doors )
item.Map = this.Map;
item.Map = Map;
}
foreach ( IEntity entity in GetHouseEntities() )
{
if ( entity is Item )
((Item)entity).Map = this.Map;
((Item)entity).Map = Map;
else
((Mobile)entity).Map = this.Map;
((Mobile)entity).Map = Map;
}
}
@ -1296,7 +1296,7 @@ namespace Server.Multis
if ( m_Region != null )
m_Region.Unregister();
if ( this.Map != null )
if ( Map != null )
{
m_Region = new HouseRegion( this );
m_Region.Register();
@ -1483,7 +1483,7 @@ namespace Server.Multis
public void AddDoor( BaseDoor door, int xoff, int yoff, int zoff )
{
door.MoveToWorld( new Point3D( xoff+this.X, yoff+this.Y, zoff+this.Z ), this.Map );
door.MoveToWorld( new Point3D( xoff+X, yoff+Y, zoff+Z ), Map );
m_Doors.Add( door );
}
@ -1530,7 +1530,7 @@ namespace Server.Multis
public void SetSign( int xoff, int yoff, int zoff )
{
m_Sign = new HouseSign( this );
m_Sign.MoveToWorld( new Point3D( this.X + xoff, this.Y + yoff, this.Z + zoff ), this.Map );
m_Sign.MoveToWorld( new Point3D( X + xoff, Y + yoff, Z + zoff ), Map );
}
private void SetLockdown( Item i, bool locked )
@ -1618,7 +1618,7 @@ namespace Server.Multis
{
m.SendLocalizedMessage( 501736 ); // You must lockdown the container first!
}
else if ( !(item is VendorRentalContract) && ( IsAosRules ? (!CheckAosLockdowns( amt ) || !CheckAosStorage( amt )) : (this.LockDownCount + amt) > m_MaxLockDowns ) )
else if ( !(item is VendorRentalContract) && ( IsAosRules ? (!CheckAosLockdowns( amt ) || !CheckAosStorage( amt )) : (LockDownCount + amt) > m_MaxLockDowns ) )
{
m.SendLocalizedMessage( 1005379 );//That would exceed the maximum lock down limit for this house
}
@ -1719,7 +1719,7 @@ namespace Server.Multis
if ( Deleted || m_House == null || m_House.Deleted || !m_House.IsOwner( from ) || !from.CheckAlive() || !to.CheckAlive() )
return false;
if ( BaseHouse.HasAccountHouse( to ) )
if ( HasAccountHouse( to ) )
{
from.SendLocalizedMessage( 501388 ); // You cannot transfer ownership to another house owner or co-owner!
return false;
@ -1804,7 +1804,7 @@ namespace Server.Multis
}
else if ( to.Player )
{
if ( BaseHouse.HasAccountHouse( to ) )
if ( HasAccountHouse( to ) )
{
from.SendLocalizedMessage( 501388 ); // You cannot transfer ownership to another house owner or co-owner!
}
@ -1824,8 +1824,8 @@ namespace Server.Multis
}
else
{
to.CloseGump( typeof( Gumps.HouseTransferGump ) );
to.SendGump( new Gumps.HouseTransferGump( from, to, this ) );
to.CloseGump( typeof( HouseTransferGump ) );
to.SendGump( new HouseTransferGump( from, to, this ) );
}
}
}
@ -1844,8 +1844,8 @@ namespace Server.Multis
if ( CheckTransferPosition( from, to ) )
{
to.CloseGump( typeof( Gumps.HouseTransferGump ) );
to.SendGump( new Gumps.HouseTransferGump( from, to, this ) );
to.CloseGump( typeof( HouseTransferGump ) );
to.SendGump( new HouseTransferGump( from, to, this ) );
}
}
@ -1868,7 +1868,7 @@ namespace Server.Multis
}
else if ( to.Player )
{
if ( BaseHouse.HasAccountHouse( to ) )
if ( HasAccountHouse( to ) )
{
from.SendLocalizedMessage( 501388 ); // You cannot transfer ownership to another house owner or co-owner!
}
@ -1913,7 +1913,7 @@ namespace Server.Multis
if ( IsLockedDown( item ) )
{
item.PublicOverheadMessage( Server.Network.MessageType.Label, 0x3B2, 501657 );//[no longer locked down]
item.PublicOverheadMessage( MessageType.Label, 0x3B2, 501657 );//[no longer locked down]
SetLockdown( item, false );
//TidyItemList( m_LockDowns );
@ -1958,7 +1958,7 @@ namespace Server.Multis
if ( info != null )
{
m.CloseGump( typeof ( SetSecureLevelGump ) );
m.SendGump( new Gumps.SetSecureLevelGump( m_Owner, info, this ) );
m.SendGump( new SetSecureLevelGump( m_Owner, info, this ) );
}
else if ( item.Parent != null )
{
@ -1994,7 +1994,7 @@ namespace Server.Multis
item.Movable = false;
m.CloseGump( typeof ( SetSecureLevelGump ) );
m.SendGump( new Gumps.SetSecureLevelGump( m_Owner, info, this ) );
m.SendGump( new SetSecureLevelGump( m_Owner, info, this ) );
}
}
}
@ -2060,7 +2060,7 @@ namespace Server.Multis
item.Movable = true;
item.SetLastMoved();
item.PublicOverheadMessage( Server.Network.MessageType.Label, 0x3B2, 501656 );//[no longer secure]
item.PublicOverheadMessage( MessageType.Label, 0x3B2, 501656 );//[no longer secure]
m_Secures.RemoveAt( i );
return;
}
@ -2617,7 +2617,7 @@ namespace Server.Multis
case 0:
{
if ( version < 14 )
m_RelativeBanLocation = this.BaseBanLocation;
m_RelativeBanLocation = BaseBanLocation;
if ( version < 12 )
{
@ -2871,9 +2871,9 @@ namespace Server.Multis
return m_Region.GoLocation;
Point3D rel = m_RelativeBanLocation;
return new Point3D( this.X + rel.X, this.Y + rel.Y, this.Z + rel.Z );
return new Point3D( X + rel.X, Y + rel.Y, Z + rel.Z );
}
set => this.RelativeBanLocation = new Point3D( value.X - this.X, value.Y - this.Y, value.Z - this.Z );
set => RelativeBanLocation = new Point3D( value.X - X, value.Y - Y, value.Z - Z );
}
[CommandProperty( AccessLevel.GameMaster )]
@ -2885,7 +2885,7 @@ namespace Server.Multis
m_RelativeBanLocation = value;
if ( m_Region != null )
m_Region.GoLocation = new Point3D( this.X + value.X, this.Y + value.Y, this.Z + value.Z );
m_Region.GoLocation = new Point3D( X + value.X, Y + value.Y, Z + value.Z );
}
}
@ -3433,7 +3433,7 @@ namespace Server.Multis
public virtual Guildstone FindGuildstone()
{
Map map = this.Map;
Map map = Map;
if ( map == null )
return null;
@ -3932,7 +3932,7 @@ namespace Server.Multis
private Mobile m_RegionOwner;
public TempNoHousingRegion( BaseHouse house, Mobile regionowner )
: base( null, house.Map, Region.DefaultPriority, house.Region.Area )
: base( null, house.Map, DefaultPriority, house.Region.Area )
{
Register();

View file

@ -965,14 +965,14 @@ namespace Server.Multis
return false;
}
else if ( this.Map != MapItem.Map || !this.Contains( MapItem.GetWorldLocation() ) )
else if ( Map != MapItem.Map || !Contains( MapItem.GetWorldLocation() ) )
{
if ( message && TillerMan != null )
TillerMan.Say( 502514 ); // The map is too far away from me, sir.
return false;
}
else if ( ( this.Map != Map.Trammel && this.Map != Map.Felucca ) || NextNavPoint < 0 || NextNavPoint >= MapItem.Pins.Count )
else if ( ( Map != Map.Trammel && Map != Map.Felucca ) || NextNavPoint < 0 || NextNavPoint >= MapItem.Pins.Count )
{
if ( message && TillerMan != null )
TillerMan.Say( 1042551 ); // I don't see that navpoint, sir.
@ -1076,7 +1076,7 @@ namespace Server.Multis
}
else
{
if ( m_MoveTimer != null && this.Order != BoatOrder.Move )
if ( m_MoveTimer != null && Order != BoatOrder.Move )
{
m_MoveTimer.Stop();
m_MoveTimer = null;
@ -1332,8 +1332,8 @@ namespace Server.Multis
public Direction GetMovementFor( int x, int y, out int maxSpeed )
{
int dx = x - this.X;
int dy = y - this.Y;
int dx = x - X;
int dy = y - Y;
int adx = Math.Abs( dx );
int ady = Math.Abs( dy );
@ -1355,7 +1355,7 @@ namespace Server.Multis
Direction dir;
int speed, clientSpeed;
if ( this.Order == BoatOrder.Move )
if ( Order == BoatOrder.Move )
{
dir = m_Moving;
speed = m_Speed;
@ -1368,14 +1368,14 @@ namespace Server.Multis
return false;
}
else if ( this.Map != MapItem.Map || !this.Contains( MapItem.GetWorldLocation() ) )
else if ( Map != MapItem.Map || !Contains( MapItem.GetWorldLocation() ) )
{
if ( message && TillerMan != null )
TillerMan.Say( 502514 ); // The map is too far away from me, sir.
return false;
}
else if ( ( this.Map != Map.Trammel && this.Map != Map.Felucca ) || NextNavPoint < 0 || NextNavPoint >= MapItem.Pins.Count )
else if ( ( Map != Map.Trammel && Map != Map.Felucca ) || NextNavPoint < 0 || NextNavPoint >= MapItem.Pins.Count )
{
if ( message && TillerMan != null )
TillerMan.Say( 1042551 ); // I don't see that navpoint, sir.
@ -1394,14 +1394,14 @@ namespace Server.Multis
if ( maxSpeed == 0 )
{
if ( message && this.Order == BoatOrder.Single && TillerMan != null )
if ( message && Order == BoatOrder.Single && TillerMan != null )
TillerMan.Say( 1042874, (NextNavPoint + 1).ToString() ); // We have arrived at nav point ~1_POINT_NUM~ , sir.
if ( NextNavPoint + 1 < MapItem.Pins.Count )
{
NextNavPoint++;
if ( this.Order == BoatOrder.Course )
if ( Order == BoatOrder.Course )
{
if ( message && TillerMan != null )
TillerMan.Say( 1042875, (NextNavPoint + 1).ToString() ); // Heading to nav point ~1_POINT_NUM~, sir.
@ -1415,7 +1415,7 @@ namespace Server.Multis
{
NextNavPoint = -1;
if ( message && this.Order == BoatOrder.Course && TillerMan != null )
if ( message && Order == BoatOrder.Course && TillerMan != null )
TillerMan.Say( 502515 ); // The course is completed, sir.
return false;
@ -1427,7 +1427,7 @@ namespace Server.Multis
else if ( dir == Right || dir == BackwardRight )
return Turn( 2, true );
speed = Math.Min( this.Speed, maxSpeed );
speed = Math.Min( Speed, maxSpeed );
clientSpeed = 0x4;
}
@ -1637,7 +1637,7 @@ namespace Server.Multis
public bool SetFacing( Direction facing )
{
if ( Parent != null || this.Map == null )
if ( Parent != null || Map == null )
return false;
if ( CheckDecay() )

View file

@ -179,7 +179,7 @@ namespace Server.Items
{
z = from.Z + j;
if ( map.CanFit( x, y, z, 16, false, false ) && !Server.Spells.SpellHelper.CheckMulti( new Point3D( x, y, z ), map ) && !Region.Find( new Point3D( x, y, z ), map ).IsPartOf( typeof( Factions.StrongholdRegion ) ) )
if ( map.CanFit( x, y, z, 16, false, false ) && !Spells.SpellHelper.CheckMulti( new Point3D( x, y, z ), map ) && !Region.Find( new Point3D( x, y, z ), map ).IsPartOf( typeof( StrongholdRegion ) ) )
{
if ( i == 1 && j >= -2 && j <= 2 )
return true;
@ -191,7 +191,7 @@ namespace Server.Items
z = map.GetAverageZ( x, y );
if ( map.CanFit( x, y, z, 16, false, false ) && !Server.Spells.SpellHelper.CheckMulti( new Point3D( x, y, z ), map ) && !Region.Find( new Point3D( x, y, z ), map ).IsPartOf( typeof( Factions.StrongholdRegion ) ) )
if ( map.CanFit( x, y, z, 16, false, false ) && !Spells.SpellHelper.CheckMulti( new Point3D( x, y, z ), map ) && !Region.Find( new Point3D( x, y, z ), map ).IsPartOf( typeof( StrongholdRegion ) ) )
{
if ( i == 1 )
return true;
@ -216,7 +216,7 @@ namespace Server.Items
if ( map == null || Deleted )
return false;
foreach ( object o in this.GetObjectsInRange( 0 ) )
foreach ( object o in GetObjectsInRange( 0 ) )
{
if ( o != this )
return false;
@ -286,12 +286,12 @@ namespace Server.Items
}
else if ( !Locked )
{
from.Location = new Point3D( this.X, this.Y, this.Z + 3 );
from.Location = new Point3D( X, Y, Z + 3 );
}
else if ( from.AccessLevel >= AccessLevel.GameMaster )
{
from.LocalOverheadMessage( Network.MessageType.Regular, 0x00, 502502 ); // That is locked but your godly powers allow access
from.Location = new Point3D( this.X, this.Y, this.Z + 3 );
from.Location = new Point3D( X, Y, Z + 3 );
}
else
{

View file

@ -86,7 +86,7 @@ namespace Server.Multis
if ( m is BaseVendor || m is Banker )
m.Direction = Direction.South;
m.MoveToWorld( loc, this.Map );
m.MoveToWorld( loc, Map );
}
public virtual void OnEnter( Mobile m )

View file

@ -177,16 +177,16 @@ namespace Server.Multis
base.OnMapChange();
if ( m_SignHanger != null )
m_SignHanger.Map = this.Map;
m_SignHanger.Map = Map;
if ( m_Signpost != null )
m_Signpost.Map = this.Map;
m_Signpost.Map = Map;
if ( m_Fixtures == null )
return;
for( int i = 0; i < m_Fixtures.Count; ++i )
m_Fixtures[i].Map = this.Map;
m_Fixtures[i].Map = Map;
}
public void ClearFixtures( Mobile from )
@ -582,7 +582,7 @@ namespace Server.Multis
public void CheckSignpost()
{
MultiComponentList mcl = this.Components;
MultiComponentList mcl = Components;
int x = mcl.Min.X;
int y = mcl.Height - 2 - mcl.Center.Y;
@ -956,7 +956,7 @@ namespace Server.Multis
int newPrice = oldPrice + CustomizationCost + ((DesignState.Components.List.Length - ( CurrentState.Components.List.Length + CurrentState.Fixtures.Length )) * 500);
int cost = newPrice - oldPrice;
if ( !this.Deleted ) { // Temporary Fix. We should be booting a client out of customization mode in the delete handler.
if ( !Deleted ) { // Temporary Fix. We should be booting a client out of customization mode in the delete handler.
if ( from.AccessLevel >= AccessLevel.GameMaster && cost != 0 )
{
from.SendMessage( "{0} gold would have been {1} your bank if you were not a GM.", cost.ToString(), ((cost > 0 )? "withdrawn from" : "deposited into" ) );
@ -1065,7 +1065,7 @@ namespace Server.Multis
{
get
{
MultiComponentList mcl = this.Components;
MultiComponentList mcl = Components;
if ( mcl.Width >= 14 || mcl.Height >= 14 )
return 4;
@ -2411,7 +2411,7 @@ namespace Server.Multis
lock (m_DeflatedBufferPool)
m_DeflatedBufferPool.ReleaseBuffer(m_DeflatedBuffer);
m_Stream.Seek( 15, System.IO.SeekOrigin.Begin );
m_Stream.Seek( 15, SeekOrigin.Begin );
Write( (short)totalLength ); // Buffer length
Write( (byte)planeCount ); // Plane count

View file

@ -85,7 +85,7 @@ namespace Server.Items
AddHtmlLocalized( 45, 80, 200, 20, 1060392, LabelColor, false, false ); // 3-Story Customizable Houses
}
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
public override void OnResponse( Network.NetState sender, RelayInfo info )
{
if ( !m_From.CheckAlive() || m_From.Backpack == null || m_From.Backpack.FindItemByType( typeof( HousePlacementTool ) ) == null )
return;
@ -193,7 +193,7 @@ namespace Server.Items
}
}
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
public override void OnResponse( Network.NetState sender, RelayInfo info )
{
if ( !m_From.CheckAlive() || m_From.Backpack == null || m_From.Backpack.FindItemByType( typeof( HousePlacementTool ) ) == null )
return;

View file

@ -210,7 +210,7 @@ namespace Server.Multis
public override void OnClick()
{
Mobile from = this.Owner.From;
Mobile from = Owner.From;
if ( !from.CheckAlive() || m_Sign.Deleted || m_Sign.Owner == null || !m_Sign.Owner.AreThereAvailableVendorsFor( from ) )
return;
@ -237,7 +237,7 @@ namespace Server.Multis
public override void OnClick()
{
Mobile from = this.Owner.From;
Mobile from = Owner.From;
if ( m_Sign.Deleted || m_Sign.Owner == null || m_Sign.Owner.VendorInventories.Count == 0 || !from.CheckAlive() )
return;
@ -281,8 +281,8 @@ namespace Server.Multis
}
}
if ( this.Name == "a house sign" )
this.Name = null;
if ( Name == "a house sign" )
Name = null;
}
}
}

View file

@ -163,7 +163,7 @@ namespace Server.Items
Point3D p = target.GetWorldTop();
Map map = target.Map;
Server.Mobiles.BaseCreature.TeleportPets( m, p, map );
Mobiles.BaseCreature.TeleportPets( m, p, map );
m.MoveToWorld( p, map );

View file

@ -53,7 +53,7 @@ namespace Server.Multis
public override void DropItem( Item dropped )
{
// 1. Try to stack the item
foreach ( Item item in this.Items )
foreach ( Item item in Items )
{
if ( item is PackingBox )
{
@ -70,7 +70,7 @@ namespace Server.Multis
}
// 2. Try to drop the item into an existing container
foreach ( Item item in this.Items )
foreach ( Item item in Items )
{
if ( item is PackingBox )
{
@ -92,7 +92,7 @@ namespace Server.Multis
Point3D location = GetFreeLocation();
if ( location != Point3D.Zero )
{
this.AddItem( subContainer );
AddItem( subContainer );
subContainer.Location = location;
}
else
@ -105,17 +105,17 @@ namespace Server.Multis
{
bool[,] positions = new bool[Rows, Columns];
foreach ( Item item in this.Items )
foreach ( Item item in Items )
{
if ( item is PackingBox )
{
int i = (item.Y - this.Bounds.Y) / VerticalSpacing;
int i = (item.Y - Bounds.Y) / VerticalSpacing;
if ( i < 0 )
i = 0;
else if ( i >= Rows )
i = Rows - 1;
int j = (item.X - this.Bounds.X) / HorizontalSpacing;
int j = (item.X - Bounds.X) / HorizontalSpacing;
if ( j < 0 )
j = 0;
else if ( j >= Columns )
@ -131,8 +131,8 @@ namespace Server.Multis
{
if ( !positions[i, j] )
{
int x = this.Bounds.X + j * HorizontalSpacing;
int y = this.Bounds.Y + i * VerticalSpacing;
int x = Bounds.X + j * HorizontalSpacing;
int y = Bounds.Y + i * VerticalSpacing;
return new Point3D( x, y, 0 );
}
@ -169,7 +169,7 @@ namespace Server.Multis
{
base.OnItemRemoved( item );
if ( this.TotalItems == 0 )
if ( TotalItems == 0 )
Delete();
}
@ -196,14 +196,14 @@ namespace Server.Multis
}
List<Item> toRemove = new List<Item>();
foreach ( Item item in this.Items )
foreach ( Item item in Items )
if ( item is PackingBox && item.Items.Count == 0 )
toRemove.Add( item );
foreach ( Item item in toRemove )
item.Delete();
if ( this.TotalItems == 0 )
if ( TotalItems == 0 )
Delete();
else
Internalize();
@ -244,7 +244,7 @@ namespace Server.Multis
}
else
{
Timer.DelayCall( TimeSpan.Zero, this.Delete );
Timer.DelayCall( TimeSpan.Zero, Delete );
}
if ( version == 0 )
@ -299,7 +299,7 @@ namespace Server.Multis
{
base.OnItemRemoved( item );
if ( item.GetBounce() == null && this.TotalItems == 0 )
if ( item.GetBounce() == null && TotalItems == 0 )
Delete();
}
@ -307,7 +307,7 @@ namespace Server.Multis
{
base.OnItemBounceCleared( item );
if ( this.TotalItems == 0 )
if ( TotalItems == 0 )
Delete();
}

View file

@ -13,7 +13,7 @@ namespace Server.Multis
{
m_Components = new List<Item>();
MultiComponentList mcl = this.Components;
MultiComponentList mcl = Components;
for ( int i = 1; i < mcl.List.Length; ++i )
{
@ -48,7 +48,7 @@ namespace Server.Multis
{
Item item = m_Components[i];
item.MoveToWorld( new Point3D( item.X + xOffset, item.Y + yOffset, item.Z + zOffset ), this.Map );
item.MoveToWorld( new Point3D( item.X + xOffset, item.Y + yOffset, item.Z + zOffset ), Map );
}
}
@ -63,7 +63,7 @@ namespace Server.Multis
{
Item item = m_Components[i];
item.Map = this.Map;
item.Map = Map;
}
}
@ -120,7 +120,7 @@ namespace Server.Multis
}
}
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( this.Delete ) );
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) );
}
private class DecayTimer : Timer