Skip to content

Commit 94a4b29

Browse files
committed
feat: reject equip-slot reward drops
1 parent 10b7fc2 commit 94a4b29

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

internal/minimal/shared_world_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,9 @@ func TestSharedWorldRegistryRegisterGroundItemRejectsUnequippedItemWithEquipSlot
372372
t.Fatal("expected equip-slot ground-item owner join to allocate a shared-world entity id")
373373
}
374374

375-
if registry.RegisterGroundItem(ownerID, "equip-slot-ground-owner", owner, 0x07000014, inventory.ItemInstance{Vnum: 3001, Count: 1, EquipSlot: inventory.EquipmentSlotWeapon}) {
376-
t.Fatal("expected unequipped ground item with equip slot metadata to fail closed")
375+
item := inventory.ItemInstance{Vnum: 3001, Count: 1, EquipSlot: inventory.EquipmentSlotWeapon}
376+
if registry.RegisterGroundItem(ownerID, "equip-slot-ground-owner", owner, 0x07000014, item) {
377+
t.Fatal("expected unequipped ground item with equip-slot metadata to fail closed")
377378
}
378379
if registry.GroundItemExists(0x07000014) {
379380
t.Fatal("expected rejected equip-slot ground item to stay absent")

spec/protocol/non-player-reward-bootstrap.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Reward descriptors fail closed when:
6161
- a runtime-generated ground-item instance for a configured item-shaped drop would have `vnum = 0`
6262
- a runtime-generated ground-item instance for a configured item-shaped drop would have zero count
6363
- a runtime-generated ground-item instance for a configured item-shaped drop would exceed the current `GC ITEM_GET` count carrier (`255`)
64+
- a runtime-generated ground-item instance for a configured item-shaped drop would carry equipped/locked state or stale equipment-slot metadata
6465
- multiple drops in the same descriptor would collide on the generated ground-item VID
6566
- a configured drop would reuse an already-live ground-item VID
6667

0 commit comments

Comments
 (0)