Fixes casting checks
This commit is contained in:
parent
7ea00fbf4f
commit
03dd5f1926
431 changed files with 5616 additions and 6250 deletions
|
|
@ -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 ) )
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue