Sets a default parameter for OnHit. More casting cleanup.

This commit is contained in:
Kamron Batman 2018-09-09 08:54:10 -07:00
parent 74f498c1c8
commit d6c0bf2d4c
96 changed files with 350 additions and 579 deletions

View file

@ -791,10 +791,8 @@ namespace Server.Items
from.SendLocalizedMessage( 1074514 ); // You have no place to put it.
return false;
}
else
{
from.SendLocalizedMessage( 1074512 ); // You put the gasping creature into your pack.
}
from.SendLocalizedMessage( 1074512 ); // You put the gasping creature into your pack.
}
if ( !fish.Dead )
@ -871,24 +869,21 @@ namespace Server.Items
if ( IsFull )
{
if ( from != null )
from.SendLocalizedMessage( 1073636 ); // The decoration will not fit in the aquarium.
from?.SendLocalizedMessage( 1073636 ); // The decoration will not fit in the aquarium.
return false;
}
if ( !Accepts( item ) )
{
if ( from != null )
from.SendLocalizedMessage( 1073822 ); // The aquarium can not hold that item.
from?.SendLocalizedMessage( 1073822 ); // The aquarium can not hold that item.
return false;
}
AddItem( item );
if ( from != null )
from.SendLocalizedMessage( 1073635, ( item.LabelNumber != 0 ) ? String.Format( "#{0}", item.LabelNumber ) : item.Name ); // You add the following decoration to your aquarium: ~1_NAME~
from?.SendLocalizedMessage( 1073635, ( item.LabelNumber != 0 ) ? String.Format( "#{0}", item.LabelNumber ) : item.Name ); // You add the following decoration to your aquarium: ~1_NAME~
InvalidateProperties();
return true;

View file

@ -30,7 +30,7 @@ namespace Server.Items
DisplayPage( i, edit );
}
public virtual void DisplayPage( int page, bool edit )
public void DisplayPage( int page, bool edit )
{
AddPage( page );

View file

@ -28,8 +28,7 @@ namespace Server.Items
public virtual void StartTimer()
{
if ( m_Timer != null )
m_Timer.Stop();
m_Timer?.Stop();
m_Timer = Timer.DelayCall( DeathDelay, new TimerCallback( Kill ) );
@ -38,8 +37,7 @@ namespace Server.Items
public virtual void StopTimer()
{
if ( m_Timer != null )
m_Timer.Stop();
m_Timer?.Stop();
m_Timer = null;
@ -64,7 +62,7 @@ namespace Server.Items
// TODO: This will never return "very unusual dead aquarium creature" due to the way it is killed
if ( ItemID > 0x3B0F )
return Dead ? 1074424 : 1074422; // A very unusual [dead/live] aquarium creature
else if ( Hue != 0 )
if ( Hue != 0 )
return Dead ? 1074425 : 1074423; // A [dead/live] aquarium creature of unusual color
return Dead ? 1073623 : 1073622; // A [dead/live] aquarium creature