Code cleanup (#188)

This commit is contained in:
Kamron Batman 2020-08-01 08:40:06 -07:00 committed by GitHub
parent df53c16620
commit 010fd9402a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
185 changed files with 1052 additions and 1271 deletions

View file

@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*************************************************************************/
using System;
namespace Server.Network
{
public sealed class DamagePacketOld : Packet
@ -30,12 +32,7 @@ namespace Server.Network
Stream.Write((byte)1);
Stream.Write(mobile);
if (amount > 255)
amount = 255;
else if (amount < 0)
amount = 0;
Stream.Write((byte)amount);
Stream.Write((byte)Math.Clamp(amount, 0, 255));
}
}
@ -45,12 +42,7 @@ namespace Server.Network
{
Stream.Write(mobile);
if (amount > 0xFFFF)
amount = 0xFFFF;
else if (amount < 0)
amount = 0;
Stream.Write((ushort)amount);
Stream.Write((ushort)Math.Clamp(amount, 0, 0xFFFF));
}
}
}