Fixes casting checks

This commit is contained in:
Kamron Batman 2018-08-19 01:38:55 +08:00
parent 7ea00fbf4f
commit 03dd5f1926
431 changed files with 5616 additions and 6250 deletions

View file

@ -610,11 +610,11 @@ namespace Server.Multis
bool retainDeedHue = false; //if the items aren't hued but the deed itself is
int hue = 0;
if( addon is IAddon )
if ( addon is IAddon )
{
deed = ((IAddon)addon).Deed;
if( addon is BaseAddon && ((BaseAddon)addon).RetainDeedHue) //There are things that are IAddon which aren't BaseAddon
if ( addon is BaseAddon && ((BaseAddon)addon).RetainDeedHue) //There are things that are IAddon which aren't BaseAddon
{
BaseAddon ba = (BaseAddon)addon;
retainDeedHue = true;
@ -623,7 +623,7 @@ namespace Server.Multis
{
AddonComponent c = ba.Components[i];
if( c.Hue != 0 )
if ( c.Hue != 0 )
hue = c.Hue;
}
}
@ -645,7 +645,7 @@ namespace Server.Multis
addon.Delete();
if( retainDeedHue )
if ( retainDeedHue )
deed.Hue = hue;
DropToMovingCrate( deed );
@ -803,13 +803,13 @@ namespace Server.Multis
if ( item is StrongBox )
relocateItem = ((StrongBox)item).ConvertToStandardContainer();
if( item is IAddon )
if ( item is IAddon )
{
Item deed = ((IAddon)item).Deed;
bool retainDeedHue = false; //if the items aren't hued but the deed itself is
int hue = 0;
if( item is BaseAddon && ((BaseAddon)item).RetainDeedHue ) //There are things that are IAddon which aren't BaseAddon
if ( item is BaseAddon && ((BaseAddon)item).RetainDeedHue ) //There are things that are IAddon which aren't BaseAddon
{
BaseAddon ba = (BaseAddon)item;
retainDeedHue = true;
@ -818,7 +818,7 @@ namespace Server.Multis
{
AddonComponent c = ba.Components[i];
if( c.Hue != 0 )
if ( c.Hue != 0 )
hue = c.Hue;
}
}
@ -893,7 +893,7 @@ namespace Server.Multis
public List<Item> GetItems()
{
if( this.Map == null || this.Map == Map.Internal )
if ( this.Map == null || this.Map == Map.Internal )
return new List<Item>();
Point2D start = new Point2D( this.X + Components.Min.X, this.Y + Components.Min.Y );
@ -915,7 +915,7 @@ namespace Server.Multis
public List<Mobile> GetMobiles()
{
if( this.Map == null || this.Map == Map.Internal )
if ( this.Map == null || this.Map == Map.Internal )
return new List<Mobile>();
List<Mobile> list = new List<Mobile>();
@ -1893,7 +1893,7 @@ namespace Server.Multis
{
to.SendLocalizedMessage( 1062071 ); // You cannot trade a house while you have other trades pending.
}
else if( !to.Alive )
else if ( !to.Alive )
{
// TODO: Check if the message is correct.
from.SendLocalizedMessage( 1062069 ); // You cannot transfer this house to that person.
@ -3179,14 +3179,14 @@ namespace Server.Multis
if ( item != null )
{
if( !item.Deleted && item is IAddon )
if ( !item.Deleted && item is IAddon )
{
Item deed = ((IAddon)item).Deed;
bool retainDeedHue = false; //if the items aren't hued but the deed itself is
int hue = 0;
if( item is BaseAddon && ((BaseAddon)item).RetainDeedHue ) //There are things that are IAddon which aren't BaseAddon
if ( item is BaseAddon && ((BaseAddon)item).RetainDeedHue ) //There are things that are IAddon which aren't BaseAddon
{
BaseAddon ba = (BaseAddon)item;
retainDeedHue = true;
@ -3195,14 +3195,14 @@ namespace Server.Multis
{
AddonComponent c = ba.Components[j];
if( c.Hue != 0 )
if ( c.Hue != 0 )
hue = c.Hue;
}
}
if( deed != null )
if ( deed != null )
{
if( retainDeedHue )
if ( retainDeedHue )
deed.Hue = hue;
deed.MoveToWorld( item.Location, item.Map );
}
@ -3287,7 +3287,7 @@ namespace Server.Multis
public bool IsGuildMember( Mobile m )
{
if( m == null || Owner == null || Owner.Guild == null )
if ( m == null || Owner == null || Owner.Guild == null )
return false;
return ( m.Guild == Owner.Guild );

View file

@ -467,7 +467,7 @@ namespace Server.Multis
{
m_DecayTime = DateTime.UtcNow + BoatDecayDelay;
if( m_TillerMan != null )
if ( m_TillerMan != null )
m_TillerMan.InvalidateProperties();
}
@ -1299,9 +1299,9 @@ namespace Server.Multis
public static Rectangle2D[] GetWrapFor( Map m )
{
if( m == Map.Ilshenar )
if ( m == Map.Ilshenar )
return m_IlshWrap;
else if( m == Map.Tokuno )
else if ( m == Map.Tokuno )
return m_TokunoWrap;
else
return m_BritWrap;

View file

@ -128,13 +128,13 @@ namespace Server.Misc
Point2D[] list;
if( map == Map.Felucca )
if ( map == Map.Felucca )
list = m_Felucca;
else if( map == Map.Trammel )
else if ( map == Map.Trammel )
list = m_Trammel;
else if( map == Map.Ilshenar )
else if ( map == Map.Ilshenar )
list = m_Ilshenar;
else if( map == Map.Tokuno )
else if ( map == Map.Tokuno )
list = m_Tokuno;
else
return;
@ -181,4 +181,4 @@ namespace Server.Misc
from.Location = new Point3D( x, y, z );
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -242,7 +242,7 @@ namespace Server.Multis
m_House = reader.ReadItem() as BaseHouse;
if( m_House != null )
if ( m_House != null )
{
m_House.MovingCrate = this;
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Hide ) );