Fixes null propogation

This commit is contained in:
Kamron Batman 2018-09-14 13:49:23 -07:00
parent 22ab83ea9e
commit 3c9842ee5a
218 changed files with 799 additions and 1458 deletions

View file

@ -47,17 +47,14 @@ namespace Server.Items
ItemID = 0x1765;
if ( Owner != null )
{
Container pack = Owner.Backpack;
Container pack = Owner?.Backpack;
if ( pack != null )
if ( pack != null )
{
for ( int i = 0; i < pack.Items.Count; i++ )
{
for ( int i = 0; i < pack.Items.Count; i++ )
{
if ( pack.Items[ i ] is PlagueBeastMainOrgan main && main.Complete )
main.FinishOpening( from );
}
if ( pack.Items[ i ] is PlagueBeastMainOrgan main && main.Complete )
main.FinishOpening( @from );
}
}
@ -74,8 +71,7 @@ namespace Server.Items
if ( Patched )
return;
if ( Owner != null )
Owner.PlaySound( 0x25 );
Owner?.PlaySound( 0x25 );
if ( ItemID == 0x122A )
{

View file

@ -98,8 +98,7 @@ namespace Server.Items
{
m_Opened = true;
if ( Owner != null )
Owner.PlaySound( 0x50 );
Owner?.PlaySound( 0x50 );
}
public PlagueBeastOrgan( Serial serial ) : base( serial )
@ -145,8 +144,7 @@ namespace Server.Items
{
ItemID = 0x1249;
if ( Owner != null )
Owner.PlaySound( 0x187 );
Owner?.PlaySound( 0x187 );
AddComponent( new PlagueBeastComponent( 0x1D0D, 0x0 ), 22, 3 );
AddComponent( new PlagueBeastComponent( 0x1D12, 0x0 ), 15, 18 );
@ -398,8 +396,7 @@ namespace Server.Items
from.SendAsciiMessage( 0x3B2, "* You place the healthy gland inside the organ sac *" );
item.Movable = false;
if ( Owner != null )
Owner.PlaySound( 0x20 );
Owner?.PlaySound( 0x20 );
return true;
}

View file

@ -48,8 +48,7 @@ namespace Server.Items
else
ItemID = 0x1B1C;
if ( Owner != null )
Owner.PlaySound( 0x199 );
Owner?.PlaySound( 0x199 );
if ( Organ is PlagueBeastRubbleOrgan organ )
organ.OnVeinCut( from, this );