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

@ -27,9 +27,7 @@ namespace Server.Ethics.Evil
{
Player from = state as Player;
IPoint3D p = obj as IPoint3D;
if ( p == null )
if ( !(obj is IPoint3D p) )
return;
if ( !CheckInvoke( from ) )

View file

@ -25,11 +25,10 @@ namespace Server.Ethics.Evil
private void Power_OnTarget( Mobile fromMobile, object obj, object state )
{
Player from = state as Player;
if (!(state is Player from))
return;
Item item = obj as Item;
if ( item == null )
if ( !(obj is Item item) )
{
from.Mobile.LocalOverheadMessage( Server.Network.MessageType.Regular, 0x3B2, false, "You may not imbue that." );
return;