fix: Fixes various mobile packets and setting serials (#1618)

### Summary
- Removes old death packet that isn't used. Doubtful this causes issues with clients that are v4+.
- Removes duplicate incoming packets. Again, probably to fix some old client issues, doubtful it affects clients v4+.
- Fixes setting serials and entities in props/commands. Note: Disabled setting `Parent` since the new sector code has issues. We shouldn't rely on it anyway!
- Reverts a recent change to healthbars that should not have been made. Oops!
This commit is contained in:
Kamron Batman 2023-11-26 00:42:15 -08:00 • committed by GitHub
parent 332e22f509
commit 6a0fcd62c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 35 deletions

View file

@ -585,7 +585,8 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
}
}
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Developer)]
// Note: Setting the parent via command/props causes problems.
[CommandProperty(AccessLevel.GameMaster, readOnly: true)]
public IEntity Parent
{
get => m_Parent;

View file

@ -4564,7 +4564,6 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
}
}
SendIncomingPacket();
SendIncomingPacket();
OnAfterResurrect();
@ -4860,7 +4859,7 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
}
else
{
m_NetState.SendDeathStatus(true);
m_NetState.SendDeathStatus();
Warmode = false;
@ -4886,8 +4885,6 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
ProcessDelta();
m_NetState.SendDeathStatus(false);
CheckStatTimers();
}
}
@ -6923,14 +6920,8 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
if (ns.StygianAbyss)
{
if (m.Blessed || m.YellowHealthbar)
{
ns.SendMobileHealthbar(m, Healthbar.Yellow);
}
else if (m.Poisoned)
{
ns.SendMobileHealthbar(m, Healthbar.Poison);
}
ns.SendMobileHealthbar(m, Healthbar.Yellow);
ns.SendMobileHealthbar(m, Healthbar.Poison);
}
if (m.IsDeadBondedPet)

View file

@ -60,8 +60,8 @@ public static class OutgoingPlayerPackets
ns?.Send(stackalloc byte[] { 0xC8, range });
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void SendDeathStatus(this NetState ns, bool dead) =>
ns?.Send(stackalloc byte[] { 0x2C, dead ? (byte)0 : (byte)2 });
public static void SendDeathStatus(this NetState ns) =>
ns?.Send(stackalloc byte[] { 0x2C, 2 });
public static void SendDisplayProfile(this NetState ns, Serial m, string header, string body, string footer)
{