Cleanup/Housekeeping (#242)

This commit is contained in:
Kamron Batman 2020-09-12 15:31:21 -07:00 committed by GitHub
parent 90ede0659f
commit 741e8d8300
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
228 changed files with 6292 additions and 2690 deletions

View file

@ -1,23 +1,3 @@
/***************************************************************************
* Effects.cs
* -------------------
* begin : May 1, 2002
* copyright : (C) The RunUO Software Team
* email : info@runuo.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
using Server.Network;
namespace Server
@ -51,7 +31,9 @@ namespace Server
public static void PlaySound(IPoint3D p, Map map, int soundID)
{
if (soundID <= -1)
{
return;
}
if (map != null)
{
@ -89,7 +71,9 @@ namespace Server
var map = e.Map;
if (map == null)
{
return;
}
e.ProcessDelta();
@ -98,6 +82,7 @@ namespace Server
var eable = map.GetClientsInRange(e.Location);
foreach (var state in eable)
{
if (state.Mobile.CanSee(e))
{
if (SendParticlesTo(state))
@ -118,6 +103,7 @@ namespace Server
state.Send(playSound);
}
}
}
Packet.Release(preEffect);
Packet.Release(boltEffect);
@ -220,7 +206,9 @@ namespace Server
public static void SendTargetEffect(IEntity target, int itemID, int speed, int duration, int hue, int renderMode)
{
if (target is Mobile mobile)
{
mobile.ProcessDelta();
}
SendPacket(target.Location, target.Map, new TargetEffect(target, itemID, speed, duration, hue, renderMode));
}
@ -247,7 +235,9 @@ namespace Server
)
{
if (target is Mobile mobile)
{
mobile.ProcessDelta();
}
var map = target.Map;
@ -302,10 +292,14 @@ namespace Server
)
{
if (from is Mobile mobile)
{
mobile.ProcessDelta();
}
if (to is Mobile mobile1)
{
mobile1.ProcessDelta();
}
SendPacket(
from.Location,
@ -389,10 +383,14 @@ namespace Server
)
{
if (from is Mobile fromMob)
{
fromMob.ProcessDelta();
}
if (to is Mobile toMob)
{
toMob.ProcessDelta();
}
var map = from.Map;
@ -461,7 +459,9 @@ namespace Server
public static void SendPacket(Point3D origin, Map map, Packet p)
{
if (map == null)
{
return;
}
var eable = map.GetClientsInRange(origin);
@ -481,7 +481,9 @@ namespace Server
public static void SendPacket(IPoint3D origin, Map map, Packet p)
{
if (map == null)
{
return;
}
var eable = map.GetClientsInRange(new Point3D(origin));