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

@ -219,8 +219,8 @@ namespace Server
public static void SendTargetEffect( IEntity target, int itemID, int speed, int duration, int hue, int renderMode )
{
if ( target is Mobile )
((Mobile)target).ProcessDelta();
if ( target is Mobile mobile )
mobile.ProcessDelta();
SendPacket( target.Location, target.Map, new TargetEffect( target, itemID, speed, duration, hue, renderMode ) );
}
@ -237,8 +237,8 @@ namespace Server
public static void SendTargetParticles( IEntity target, int itemID, int speed, int duration, int hue, int renderMode, int effect, EffectLayer layer, int unknown )
{
if ( target is Mobile )
((Mobile)target).ProcessDelta();
if ( target is Mobile mobile )
mobile.ProcessDelta();
Map map = target.Map;
@ -280,11 +280,11 @@ namespace Server
public static void SendMovingEffect( IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes, int hue, int renderMode )
{
if ( from is Mobile )
((Mobile)from).ProcessDelta();
if ( from is Mobile mobile )
mobile.ProcessDelta();
if ( to is Mobile )
((Mobile)to).ProcessDelta();
if ( to is Mobile mobile1 )
mobile1.ProcessDelta();
SendPacket( from.Location, from.Map, new MovingEffect( from, to, itemID, speed, duration, fixedDirection, explodes, hue, renderMode ) );
}
@ -306,11 +306,11 @@ namespace Server
public static void SendMovingParticles( IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes, int hue, int renderMode, int effect, int explodeEffect, int explodeSound, EffectLayer layer, int unknown )
{
if ( from is Mobile )
((Mobile)from).ProcessDelta();
if ( from is Mobile mobile )
mobile.ProcessDelta();
if ( to is Mobile )
((Mobile)to).ProcessDelta();
if ( to is Mobile mobile1 )
mobile1.ProcessDelta();
Map map = from.Map;
@ -382,4 +382,4 @@ namespace Server
}
}
}
}
}