fix #211: index login-equipped items under player
Project PlayerDescription equipment through the same contained-by-wielder ownership and ordered contents index as live WieldObject updates. Preserve equip masks and priorities so retail GetObjectAtLocation selects Missile for an already-equipped crossbow instead of sending a server-rejected Melee request. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
e74efc5c06
commit
ab98cda26b
6 changed files with 150 additions and 12 deletions
|
|
@ -359,6 +359,28 @@ public sealed class ClientObjectTableTests
|
|||
Assert.Equal(0u, o.IconId); // data not set — CreateObject fills it
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RecordMembership_OwnedEquip_UsesSameIndexShapeAsLiveWield()
|
||||
{
|
||||
const uint playerGuid = 0x50000001u;
|
||||
const uint weaponGuid = 0x500000B9u;
|
||||
var table = new ClientObjectTable();
|
||||
|
||||
table.RecordMembership(
|
||||
weaponGuid,
|
||||
containerId: playerGuid,
|
||||
equip: EquipMask.MissileWeapon,
|
||||
priority: 7u);
|
||||
|
||||
var weapon = table.Get(weaponGuid);
|
||||
Assert.NotNull(weapon);
|
||||
Assert.Equal(playerGuid, weapon!.ContainerId);
|
||||
Assert.Equal(-1, weapon.ContainerSlot);
|
||||
Assert.Equal(EquipMask.MissileWeapon, weapon.CurrentlyEquippedLocation);
|
||||
Assert.Equal(7u, weapon.Priority);
|
||||
Assert.Equal(new[] { weaponGuid }, table.GetContents(playerGuid));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ingest_AfterMembership_FillsData_NoDuplicate() // out-of-order: PD then CreateObject
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue