fix(network): Adds UOG & Fixes ConnectUO packet (#552)
- [X] Adds UOG Extended and Compact (0xF1 0x51 packet) - [X] Fixes ConnectUO bad length
This commit is contained in:
parent
5e3b42bf9c
commit
c50322c0e3
25 changed files with 196 additions and 38 deletions
|
|
@ -284,7 +284,7 @@ namespace Server.Items
|
|||
|
||||
var rx = from.X - X;
|
||||
var ry = from.Y - Y;
|
||||
var az = Math.Abs(from.Z - Z);
|
||||
var az = (from.Z - Z).Abs();
|
||||
|
||||
return rx >= x && rx < x + w && ry >= y && ry < y + h && az <= 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace Server.Items
|
|||
{
|
||||
var p = GetWorldLocation();
|
||||
|
||||
if (Utility.Random(Math.Max(Math.Abs(from.X - p.X), Math.Abs(from.Y - p.Y))) < 1)
|
||||
if (Utility.Random(Math.Max((from.X - p.X).Abs(), (from.Y - p.Y).Abs())) < 1)
|
||||
{
|
||||
Effects.PlaySound(from.Location, from.Map, from.GetHurtSound());
|
||||
from.PublicOverheadMessage(MessageType.Regular, from.SpeechHue, true, "Ouch!");
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ namespace Server.Items
|
|||
percent = v;
|
||||
}
|
||||
|
||||
percent *= 10000 + 10000 / (Math.Abs(high - low) + 1);
|
||||
percent *= 10000 + 10000 / ((high - low).Abs() + 1);
|
||||
|
||||
return low + (high - low) * percent / 1000001;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,28 +291,28 @@ namespace Server.Items
|
|||
switch (m_Cannon.CannonDirection)
|
||||
{
|
||||
case CannonDirection.North:
|
||||
if (y < 0 && Math.Abs(x) <= -y / 3)
|
||||
if (y < 0 && x.Abs() <= -y / 3)
|
||||
{
|
||||
allow = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case CannonDirection.East:
|
||||
if (x > 0 && Math.Abs(y) <= x / 3)
|
||||
if (x > 0 && y.Abs() <= x / 3)
|
||||
{
|
||||
allow = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case CannonDirection.South:
|
||||
if (y > 0 && Math.Abs(x) <= y / 3)
|
||||
if (y > 0 && x.Abs() <= y / 3)
|
||||
{
|
||||
allow = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case CannonDirection.West:
|
||||
if (x < 0 && Math.Abs(y) <= -x / 3)
|
||||
if (x < 0 && y.Abs() <= -x / 3)
|
||||
{
|
||||
allow = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue