Fixes casting, default parameters and null propogation in more files.

This commit is contained in:
Kamron Batman 2018-09-09 22:05:44 -07:00
parent 067dca8393
commit 403e2a8b9d
21 changed files with 328 additions and 523 deletions

View file

@ -117,12 +117,9 @@ namespace Server
public static void HWInfo_OnTarget( Mobile from, object obj )
{
if ( obj is Mobile && ((Mobile)obj).Player )
if ( obj is Mobile m && m.Player )
{
Mobile m = (Mobile)obj;
Account acct = m.Account as Account;
if ( acct != null )
if ( m.Account is Account acct )
{
HardwareInfo hwInfo = acct.HardwareInfo;
@ -180,9 +177,7 @@ namespace Server
info.m_TimeReceived = DateTime.UtcNow;
Account acct = state.Account as Account;
if ( acct != null )
if ( state.Account is Account acct )
acct.HardwareInfo = info;
}
}