Fixes null propogation
This commit is contained in:
parent
22ab83ea9e
commit
3c9842ee5a
218 changed files with 799 additions and 1458 deletions
|
|
@ -235,8 +235,7 @@ namespace Server.Multis
|
|||
if ( DynamicDecay.Enabled )
|
||||
ResetDynamicDecay();
|
||||
|
||||
if ( m_Sign != null )
|
||||
m_Sign.InvalidateProperties();
|
||||
m_Sign?.InvalidateProperties();
|
||||
|
||||
return ( oldLevel > DecayLevel.LikeNew );
|
||||
}
|
||||
|
|
@ -542,8 +541,7 @@ namespace Server.Multis
|
|||
{
|
||||
RelocatedEntities.Clear();
|
||||
|
||||
if ( MovingCrate != null )
|
||||
MovingCrate.Hide();
|
||||
MovingCrate?.Hide();
|
||||
|
||||
if ( m_Trash != null )
|
||||
{
|
||||
|
|
@ -676,8 +674,7 @@ namespace Server.Multis
|
|||
{
|
||||
List<IEntity> list = new List<IEntity>();
|
||||
|
||||
if ( MovingCrate != null )
|
||||
MovingCrate.Hide();
|
||||
MovingCrate?.Hide();
|
||||
|
||||
if ( m_Trash != null && m_Trash.Map != Map.Internal )
|
||||
list.Add( m_Trash );
|
||||
|
|
@ -1293,8 +1290,7 @@ namespace Server.Multis
|
|||
|
||||
public virtual void UpdateRegion()
|
||||
{
|
||||
if ( m_Region != null )
|
||||
m_Region.Unregister();
|
||||
m_Region?.Unregister();
|
||||
|
||||
if ( Map != null )
|
||||
{
|
||||
|
|
@ -1917,8 +1913,7 @@ namespace Server.Multis
|
|||
SetLockdown( item, false );
|
||||
//TidyItemList( m_LockDowns );
|
||||
|
||||
if ( item is RewardBrazier )
|
||||
((RewardBrazier) item).TurnOff();
|
||||
(item as RewardBrazier)?.TurnOff();
|
||||
}
|
||||
else if ( IsSecure( item ) )
|
||||
{
|
||||
|
|
@ -2824,8 +2819,7 @@ namespace Server.Multis
|
|||
m_Owner.Delta( MobileDelta.Noto );
|
||||
}
|
||||
|
||||
if ( m_Sign != null )
|
||||
m_Sign.InvalidateProperties();
|
||||
m_Sign?.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2849,8 +2843,7 @@ namespace Server.Multis
|
|||
if ( !m_Public ) // Privatizing the house, change to brass sign
|
||||
ChangeSignType( 0xBD2 );
|
||||
|
||||
if ( m_Sign != null )
|
||||
m_Sign.InvalidateProperties();
|
||||
m_Sign?.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3073,11 +3066,9 @@ namespace Server.Multis
|
|||
m_Region = null;
|
||||
}
|
||||
|
||||
if ( m_Sign != null )
|
||||
m_Sign.Delete();
|
||||
m_Sign?.Delete();
|
||||
|
||||
if ( m_Trash != null )
|
||||
m_Trash.Delete();
|
||||
m_Trash?.Delete();
|
||||
|
||||
if ( m_Doors != null )
|
||||
{
|
||||
|
|
@ -3085,8 +3076,7 @@ namespace Server.Multis
|
|||
{
|
||||
Item item = (Item)m_Doors[i];
|
||||
|
||||
if ( item != null )
|
||||
item.Delete();
|
||||
item?.Delete();
|
||||
}
|
||||
|
||||
m_Doors.Clear();
|
||||
|
|
@ -3199,8 +3189,7 @@ namespace Server.Multis
|
|||
foreach ( VendorInventory inventory in inventories )
|
||||
inventory.Delete();
|
||||
|
||||
if ( MovingCrate != null )
|
||||
MovingCrate.Delete();
|
||||
MovingCrate?.Delete();
|
||||
|
||||
KillVendors();
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,9 @@ namespace Server.Multis
|
|||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string ShipName{ get => m_ShipName;
|
||||
set{ m_ShipName = value; if ( m_TillerMan != null ) m_TillerMan.InvalidateProperties(); } }
|
||||
set{ m_ShipName = value;
|
||||
m_TillerMan?.InvalidateProperties();
|
||||
} }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public BoatOrder Order{ get => m_Order;
|
||||
|
|
@ -129,7 +131,9 @@ namespace Server.Multis
|
|||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime TimeOfDecay{ get => m_DecayTime;
|
||||
set{ m_DecayTime = value; if ( m_TillerMan != null ) m_TillerMan.InvalidateProperties(); } }
|
||||
set{ m_DecayTime = value;
|
||||
m_TillerMan?.InvalidateProperties();
|
||||
} }
|
||||
|
||||
public int Status
|
||||
{
|
||||
|
|
@ -366,23 +370,17 @@ namespace Server.Multis
|
|||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Delete();
|
||||
m_TillerMan?.Delete();
|
||||
|
||||
if ( m_Hold != null )
|
||||
m_Hold.Delete();
|
||||
m_Hold?.Delete();
|
||||
|
||||
if ( m_PPlank != null )
|
||||
m_PPlank.Delete();
|
||||
m_PPlank?.Delete();
|
||||
|
||||
if ( m_SPlank != null )
|
||||
m_SPlank.Delete();
|
||||
m_SPlank?.Delete();
|
||||
|
||||
if ( m_TurnTimer != null )
|
||||
m_TurnTimer.Stop();
|
||||
m_TurnTimer?.Stop();
|
||||
|
||||
if ( m_MoveTimer != null )
|
||||
m_MoveTimer.Stop();
|
||||
m_MoveTimer?.Stop();
|
||||
|
||||
m_Instances.Remove( this );
|
||||
}
|
||||
|
|
@ -490,8 +488,7 @@ namespace Server.Multis
|
|||
{
|
||||
m_DecayTime = DateTime.UtcNow + BoatDecayDelay;
|
||||
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.InvalidateProperties();
|
||||
m_TillerMan?.InvalidateProperties();
|
||||
}
|
||||
|
||||
private class DecayTimer : Timer
|
||||
|
|
@ -517,8 +514,7 @@ namespace Server.Multis
|
|||
{
|
||||
m_Boat.Location = new Point3D( m_Boat.X, m_Boat.Y, m_Boat.Z - 1 );
|
||||
|
||||
if ( m_Boat.TillerMan != null )
|
||||
m_Boat.TillerMan.Say( 1007168 + m_Count );
|
||||
m_Boat.TillerMan?.Say( 1007168 + m_Count );
|
||||
|
||||
++m_Count;
|
||||
}
|
||||
|
|
@ -549,8 +545,8 @@ namespace Server.Multis
|
|||
|
||||
if ( m_Anchored )
|
||||
{
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501445 ); // Ar, the anchor was already dropped sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501445 ); // Ar, the anchor was already dropped sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -559,8 +555,8 @@ namespace Server.Multis
|
|||
|
||||
m_Anchored = true;
|
||||
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501444 ); // Ar, anchor dropped sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501444 ); // Ar, anchor dropped sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -572,16 +568,16 @@ namespace Server.Multis
|
|||
|
||||
if ( !m_Anchored )
|
||||
{
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501447 ); // Ar, the anchor has not been dropped sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501447 ); // Ar, the anchor has not been dropped sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
m_Anchored = false;
|
||||
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501446 ); // Ar, anchor raised sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501446 ); // Ar, anchor raised sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -598,8 +594,7 @@ namespace Server.Multis
|
|||
|
||||
if ( StartMove( dir, speed, clientSpeed, interval, false, true ) )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 501429 ); // Aye aye sir.
|
||||
m_TillerMan?.Say( 501429 ); // Aye aye sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -618,8 +613,7 @@ namespace Server.Multis
|
|||
|
||||
if ( StartMove( dir, speed, 0x1, interval, true, true ) )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 501429 ); // Aye aye sir.
|
||||
m_TillerMan?.Say( 501429 ); // Aye aye sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -634,14 +628,12 @@ namespace Server.Multis
|
|||
|
||||
if ( from.AccessLevel < AccessLevel.GameMaster && from != m_Owner )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( Utility.Random( 1042876, 4 ) ); // Arr, don't do that! | Arr, leave me alone! | Arr, watch what thour'rt doing, matey! | Arr! Do that again and I’ll throw ye overhead!
|
||||
m_TillerMan?.Say( Utility.Random( 1042876, 4 ) ); // Arr, don't do that! | Arr, leave me alone! | Arr, watch what thour'rt doing, matey! | Arr! Do that again and I’ll throw ye overhead!
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502580 ); // What dost thou wish to name thy ship?
|
||||
m_TillerMan?.Say( 502580 ); // What dost thou wish to name thy ship?
|
||||
|
||||
from.Prompt = new RenameBoatPrompt( this );
|
||||
}
|
||||
|
|
@ -653,15 +645,13 @@ namespace Server.Multis
|
|||
|
||||
if ( from.AccessLevel < AccessLevel.GameMaster && from != m_Owner )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 1042880 ); // Arr! Only the owner of the ship may change its name!
|
||||
m_TillerMan?.Say( 1042880 ); // Arr! Only the owner of the ship may change its name!
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( !from.Alive )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502582 ); // You appear to be dead.
|
||||
m_TillerMan?.Say( 502582 ); // You appear to be dead.
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -771,15 +761,13 @@ namespace Server.Multis
|
|||
|
||||
if ( e.Mobile.AccessLevel < AccessLevel.GameMaster && e.Mobile != m_Owner )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 1042880 ); // Arr! Only the owner of the ship may change its name!
|
||||
m_TillerMan?.Say( 1042880 ); // Arr! Only the owner of the ship may change its name!
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( !e.Mobile.Alive )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502582 ); // You appear to be dead.
|
||||
m_TillerMan?.Say( 502582 ); // You appear to be dead.
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -805,8 +793,7 @@ namespace Server.Multis
|
|||
|
||||
if ( m_ShipName == newName )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502531 ); // Yes, sir.
|
||||
m_TillerMan?.Say( 502531 ); // Yes, sir.
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -815,8 +802,10 @@ namespace Server.Multis
|
|||
|
||||
if ( m_TillerMan != null && m_ShipName != null )
|
||||
m_TillerMan.Say( 1042885, m_ShipName ); // This ship is now called the ~1_NEW_SHIP_NAME~.
|
||||
else if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502534 ); // This ship now has no name.
|
||||
else
|
||||
{
|
||||
m_TillerMan?.Say( 502534 ); // This ship now has no name.
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveName( Mobile m )
|
||||
|
|
@ -826,31 +815,27 @@ namespace Server.Multis
|
|||
|
||||
if ( m.AccessLevel < AccessLevel.GameMaster && m != m_Owner )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 1042880 ); // Arr! Only the owner of the ship may change its name!
|
||||
m_TillerMan?.Say( 1042880 ); // Arr! Only the owner of the ship may change its name!
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( !m.Alive )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502582 ); // You appear to be dead.
|
||||
m_TillerMan?.Say( 502582 ); // You appear to be dead.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_ShipName == null )
|
||||
{
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502526 ); // Ar, this ship has no name.
|
||||
m_TillerMan?.Say( 502526 ); // Ar, this ship has no name.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ShipName = null;
|
||||
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.Say( 502534 ); // This ship now has no name.
|
||||
m_TillerMan?.Say( 502534 ); // This ship now has no name.
|
||||
}
|
||||
|
||||
public void GiveName( Mobile m )
|
||||
|
|
@ -882,13 +867,11 @@ namespace Server.Multis
|
|||
|
||||
if ( map is BlankMap )
|
||||
{
|
||||
if ( TillerMan != null )
|
||||
TillerMan.Say( 502575 ); // Ar, that is not a map, tis but a blank piece of paper!
|
||||
TillerMan?.Say( 502575 ); // Ar, that is not a map, tis but a blank piece of paper!
|
||||
}
|
||||
else if ( map.Pins.Count == 0 )
|
||||
{
|
||||
if ( TillerMan != null )
|
||||
TillerMan.Say( 502576 ); // Arrrr, this map has no course on it!
|
||||
TillerMan?.Say( 502576 ); // Arrrr, this map has no course on it!
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -897,8 +880,7 @@ namespace Server.Multis
|
|||
MapItem = map;
|
||||
NextNavPoint = -1;
|
||||
|
||||
if ( TillerMan != null )
|
||||
TillerMan.Say( 502577 ); // A map!
|
||||
TillerMan?.Say( 502577 ); // A map!
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -936,8 +918,8 @@ namespace Server.Multis
|
|||
|
||||
if ( number == -1 )
|
||||
{
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 1042551 ); // I don't see that navpoint, sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 1042551 ); // I don't see that navpoint, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -953,29 +935,29 @@ namespace Server.Multis
|
|||
|
||||
if ( Anchored )
|
||||
{
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 501419 ); // Ar, the anchor is down sir!
|
||||
if ( message )
|
||||
TillerMan?.Say( 501419 ); // Ar, the anchor is down sir!
|
||||
|
||||
return false;
|
||||
}
|
||||
else if ( MapItem == null || MapItem.Deleted )
|
||||
{
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 502513 ); // I have seen no map, sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 502513 ); // I have seen no map, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
else if ( Map != MapItem.Map || !Contains( MapItem.GetWorldLocation() ) )
|
||||
{
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 502514 ); // The map is too far away from me, sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 502514 ); // The map is too far away from me, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
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.
|
||||
if ( message )
|
||||
TillerMan?.Say( 1042551 ); // I don't see that navpoint, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -983,14 +965,13 @@ namespace Server.Multis
|
|||
Speed = FastSpeed;
|
||||
Order = single ? BoatOrder.Single : BoatOrder.Course;
|
||||
|
||||
if ( m_MoveTimer != null )
|
||||
m_MoveTimer.Stop();
|
||||
m_MoveTimer?.Stop();
|
||||
|
||||
m_MoveTimer = new MoveTimer( this, FastInterval, false );
|
||||
m_MoveTimer.Start();
|
||||
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 501429 ); // Aye aye sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 501429 ); // Aye aye sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1082,14 +1063,13 @@ namespace Server.Multis
|
|||
m_MoveTimer = null;
|
||||
}
|
||||
|
||||
if ( m_TurnTimer != null )
|
||||
m_TurnTimer.Stop();
|
||||
m_TurnTimer?.Stop();
|
||||
|
||||
m_TurnTimer = new TurnTimer( this, offset );
|
||||
m_TurnTimer.Start();
|
||||
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 501429 ); // Aye aye sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 501429 ); // Aye aye sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1153,8 +1133,8 @@ namespace Server.Multis
|
|||
|
||||
if ( m_Anchored )
|
||||
{
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501419 ); // Ar, the anchor is down sir!
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501419 ); // Ar, the anchor is down sir!
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1164,8 +1144,7 @@ namespace Server.Multis
|
|||
m_ClientSpeed = clientSpeed;
|
||||
m_Order = BoatOrder.Move;
|
||||
|
||||
if ( m_MoveTimer != null )
|
||||
m_MoveTimer.Stop();
|
||||
m_MoveTimer?.Stop();
|
||||
|
||||
m_MoveTimer = new MoveTimer( this, interval, single );
|
||||
m_MoveTimer.Start();
|
||||
|
|
@ -1180,8 +1159,8 @@ namespace Server.Multis
|
|||
|
||||
if ( m_MoveTimer == null )
|
||||
{
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501443 ); // Er, the ship is not moving sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501443 ); // Er, the ship is not moving sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1192,8 +1171,8 @@ namespace Server.Multis
|
|||
m_MoveTimer.Stop();
|
||||
m_MoveTimer = null;
|
||||
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501429 ); // Aye aye sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501429 ); // Aye aye sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1363,22 +1342,22 @@ namespace Server.Multis
|
|||
}
|
||||
else if ( MapItem == null || MapItem.Deleted )
|
||||
{
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 502513 ); // I have seen no map, sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 502513 ); // I have seen no map, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
else if ( Map != MapItem.Map || !Contains( MapItem.GetWorldLocation() ) )
|
||||
{
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 502514 ); // The map is too far away from me, sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 502514 ); // The map is too far away from me, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
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.
|
||||
if ( message )
|
||||
TillerMan?.Say( 1042551 ); // I don't see that navpoint, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1394,8 +1373,8 @@ namespace Server.Multis
|
|||
|
||||
if ( maxSpeed == 0 )
|
||||
{
|
||||
if ( message && Order == BoatOrder.Single && TillerMan != null )
|
||||
TillerMan.Say( 1042874, (NextNavPoint + 1).ToString() ); // We have arrived at nav point ~1_POINT_NUM~ , sir.
|
||||
if ( message && Order == BoatOrder.Single )
|
||||
TillerMan?.Say( 1042874, (NextNavPoint + 1).ToString() ); // We have arrived at nav point ~1_POINT_NUM~ , sir.
|
||||
|
||||
if ( NextNavPoint + 1 < MapItem.Pins.Count )
|
||||
{
|
||||
|
|
@ -1403,8 +1382,8 @@ namespace Server.Multis
|
|||
|
||||
if ( Order == BoatOrder.Course )
|
||||
{
|
||||
if ( message && TillerMan != null )
|
||||
TillerMan.Say( 1042875, (NextNavPoint + 1).ToString() ); // Heading to nav point ~1_POINT_NUM~, sir.
|
||||
if ( message )
|
||||
TillerMan?.Say( 1042875, (NextNavPoint + 1).ToString() ); // Heading to nav point ~1_POINT_NUM~, sir.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1415,8 +1394,8 @@ namespace Server.Multis
|
|||
{
|
||||
NextNavPoint = -1;
|
||||
|
||||
if ( message && Order == BoatOrder.Course && TillerMan != null )
|
||||
TillerMan.Say( 502515 ); // The course is completed, sir.
|
||||
if ( message && Order == BoatOrder.Course )
|
||||
TillerMan?.Say( 502515 ); // The course is completed, sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1443,8 +1422,8 @@ namespace Server.Multis
|
|||
|
||||
if ( m_Anchored )
|
||||
{
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501419 ); // Ar, the anchor is down sir!
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501419 ); // Ar, the anchor is down sir!
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1459,8 +1438,8 @@ namespace Server.Multis
|
|||
{
|
||||
if ( i == 1 )
|
||||
{
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501424 ); // Ar, we've stopped sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501424 ); // Ar, we've stopped sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1498,8 +1477,8 @@ namespace Server.Multis
|
|||
{
|
||||
if ( !CanFit( new Point3D( newX + (j * rx), newY + (j * ry), Z ), Map, ItemID ) )
|
||||
{
|
||||
if ( message && m_TillerMan != null )
|
||||
m_TillerMan.Say( 501424 ); // Ar, we've stopped sir.
|
||||
if ( message )
|
||||
m_TillerMan?.Say( 501424 ); // Ar, we've stopped sir.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1658,17 +1637,13 @@ namespace Server.Multis
|
|||
|
||||
m_Facing = facing;
|
||||
|
||||
if ( m_TillerMan != null )
|
||||
m_TillerMan.SetFacing( facing );
|
||||
m_TillerMan?.SetFacing( facing );
|
||||
|
||||
if ( m_Hold != null )
|
||||
m_Hold.SetFacing( facing );
|
||||
m_Hold?.SetFacing( facing );
|
||||
|
||||
if ( m_PPlank != null )
|
||||
m_PPlank.SetFacing( facing );
|
||||
m_PPlank?.SetFacing( facing );
|
||||
|
||||
if ( m_SPlank != null )
|
||||
m_SPlank.SetFacing( facing );
|
||||
m_SPlank?.SetFacing( facing );
|
||||
|
||||
List<IEntity> toMove = GetMovingEntities();
|
||||
|
||||
|
|
|
|||
|
|
@ -62,21 +62,18 @@ namespace Server.Items
|
|||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Delete();
|
||||
m_Boat?.Delete();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_Boat == null || !m_Boat.Contains( from ) )
|
||||
{
|
||||
if ( m_Boat.TillerMan != null )
|
||||
m_Boat.TillerMan.Say( 502490 ); // You must be on the ship to open the hold.
|
||||
m_Boat.TillerMan?.Say( 502490 ); // You must be on the ship to open the hold.
|
||||
}
|
||||
else if ( m_Boat.IsMoving )
|
||||
{
|
||||
if ( m_Boat.TillerMan != null )
|
||||
m_Boat.TillerMan.Say( 502491 ); // I can not open the hold while the ship is moving.
|
||||
m_Boat.TillerMan?.Say( 502491 ); // I can not open the hold while the ship is moving.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -125,8 +125,7 @@ namespace Server.Items
|
|||
if ( IsOpen || Deleted )
|
||||
return;
|
||||
|
||||
if ( m_CloseTimer != null )
|
||||
m_CloseTimer.Stop();
|
||||
m_CloseTimer?.Stop();
|
||||
|
||||
m_CloseTimer = new CloseTimer( this );
|
||||
m_CloseTimer.Start();
|
||||
|
|
@ -139,8 +138,7 @@ namespace Server.Items
|
|||
case 0x3E85: ItemID = 0x3E84; break;
|
||||
}
|
||||
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Refresh();
|
||||
m_Boat?.Refresh();
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile from )
|
||||
|
|
@ -230,8 +228,7 @@ namespace Server.Items
|
|||
if ( !IsOpen || !CanClose() || Deleted )
|
||||
return;
|
||||
|
||||
if ( m_CloseTimer != null )
|
||||
m_CloseTimer.Stop();
|
||||
m_CloseTimer?.Stop();
|
||||
|
||||
m_CloseTimer = null;
|
||||
|
||||
|
|
@ -243,8 +240,7 @@ namespace Server.Items
|
|||
case 0x3E84: ItemID = 0x3E85; break;
|
||||
}
|
||||
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Refresh();
|
||||
m_Boat?.Refresh();
|
||||
}
|
||||
|
||||
public override void OnDoubleClickDead( Mobile from )
|
||||
|
|
|
|||
|
|
@ -65,8 +65,10 @@ namespace Server.Items
|
|||
{
|
||||
if ( m_Boat != null && m_Boat.Contains( from ) )
|
||||
m_Boat.BeginRename( from );
|
||||
else if ( m_Boat != null )
|
||||
m_Boat.BeginDryDock( from );
|
||||
else
|
||||
{
|
||||
m_Boat?.BeginDryDock( @from );
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
|
|
@ -81,8 +83,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Delete();
|
||||
m_Boat?.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@ namespace Server.Multis
|
|||
if ( Deleted )
|
||||
return;
|
||||
|
||||
if ( m_DecayTimer != null )
|
||||
m_DecayTimer.Stop();
|
||||
m_DecayTimer?.Stop();
|
||||
|
||||
if ( setDecayTime )
|
||||
m_DecayTime = DateTime.UtcNow + DecayDelay;
|
||||
|
|
|
|||
|
|
@ -124,11 +124,9 @@ namespace Server.Multis
|
|||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_SignHanger != null )
|
||||
m_SignHanger.Delete();
|
||||
m_SignHanger?.Delete();
|
||||
|
||||
if ( m_Signpost != null )
|
||||
m_Signpost.Delete();
|
||||
m_Signpost?.Delete();
|
||||
|
||||
if ( m_Fixtures == null )
|
||||
return;
|
||||
|
|
@ -137,8 +135,7 @@ namespace Server.Multis
|
|||
{
|
||||
Item item = m_Fixtures[i];
|
||||
|
||||
if ( item != null )
|
||||
item.Delete();
|
||||
item?.Delete();
|
||||
}
|
||||
|
||||
m_Fixtures.Clear();
|
||||
|
|
@ -152,11 +149,9 @@ namespace Server.Multis
|
|||
int y = Location.Y - oldLocation.Y;
|
||||
int z = Location.Z - oldLocation.Z;
|
||||
|
||||
if ( m_SignHanger != null )
|
||||
m_SignHanger.MoveToWorld( new Point3D( m_SignHanger.X + x, m_SignHanger.Y + y, m_SignHanger.Z + z ), Map );
|
||||
m_SignHanger?.MoveToWorld( new Point3D( m_SignHanger.X + x, m_SignHanger.Y + y, m_SignHanger.Z + z ), Map );
|
||||
|
||||
if ( m_Signpost != null )
|
||||
m_Signpost.MoveToWorld( new Point3D( m_Signpost.X + x, m_Signpost.Y + y, m_Signpost.Z + z ), Map );
|
||||
m_Signpost?.MoveToWorld( new Point3D( m_Signpost.X + x, m_Signpost.Y + y, m_Signpost.Z + z ), Map );
|
||||
|
||||
if ( m_Fixtures == null )
|
||||
return;
|
||||
|
|
@ -589,8 +584,7 @@ namespace Server.Multis
|
|||
|
||||
if ( CheckWall( mcl, x, y ) )
|
||||
{
|
||||
if ( m_Signpost != null )
|
||||
m_Signpost.Delete();
|
||||
m_Signpost?.Delete();
|
||||
|
||||
m_Signpost = null;
|
||||
}
|
||||
|
|
@ -1696,8 +1690,7 @@ namespace Server.Multis
|
|||
if ( m_PacketCache == value )
|
||||
return;
|
||||
|
||||
if ( m_PacketCache != null )
|
||||
m_PacketCache.Release();
|
||||
m_PacketCache?.Release();
|
||||
|
||||
m_PacketCache = value;
|
||||
}
|
||||
|
|
@ -1788,8 +1781,7 @@ namespace Server.Multis
|
|||
{
|
||||
m_Revision = ++m_Foundation.LastRevision;
|
||||
|
||||
if ( m_PacketCache != null )
|
||||
m_PacketCache.Release();
|
||||
m_PacketCache?.Release();
|
||||
|
||||
m_PacketCache = null;
|
||||
}
|
||||
|
|
@ -1797,8 +1789,7 @@ namespace Server.Multis
|
|||
|
||||
public void SendGeneralInfoTo( NetState state )
|
||||
{
|
||||
if ( state != null )
|
||||
state.Send( new DesignStateGeneral( m_Foundation, this ) );
|
||||
state?.Send( new DesignStateGeneral( m_Foundation, this ) );
|
||||
}
|
||||
|
||||
public void SendDetailedInfoTo( NetState state )
|
||||
|
|
@ -2095,14 +2086,11 @@ namespace Server.Multis
|
|||
item.SendInfoTo( state );
|
||||
}
|
||||
|
||||
if ( context.Foundation.Signpost != null )
|
||||
context.Foundation.Signpost.SendInfoTo( state );
|
||||
context.Foundation.Signpost?.SendInfoTo( state );
|
||||
|
||||
if ( context.Foundation.SignHanger != null )
|
||||
context.Foundation.SignHanger.SendInfoTo( state );
|
||||
context.Foundation.SignHanger?.SendInfoTo( state );
|
||||
|
||||
if ( context.Foundation.Sign != null )
|
||||
context.Foundation.Sign.SendInfoTo( state );
|
||||
context.Foundation.Sign?.SendInfoTo( state );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ namespace Server.Multis
|
|||
// 2. Try to drop the item into an existing container
|
||||
foreach ( Item item in Items )
|
||||
{
|
||||
if ( item is PackingBox )
|
||||
if ( item is PackingBox packingBox )
|
||||
{
|
||||
Container box = (Container) item;
|
||||
Container box = packingBox;
|
||||
List<Item> subItems = box.Items;
|
||||
|
||||
if ( subItems.Count < MaxItemsPerSubcontainer )
|
||||
|
|
@ -216,8 +216,7 @@ namespace Server.Multis
|
|||
if ( House != null && House.MovingCrate == this )
|
||||
House.MovingCrate = null;
|
||||
|
||||
if ( m_InternalizeTimer != null )
|
||||
m_InternalizeTimer.Stop();
|
||||
m_InternalizeTimer?.Stop();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue