fix(net): sign-extend retail capacity bytes
Mirror PublicWeenieDesc::UnPack MOVSX behavior so ACE's FF capacity sentinels remain -1 instead of becoming 255. This suppresses non-container capacity prose through the normal retail appraisal checks, with raw-wire and formatter regression coverage. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
d3c5e06fdd
commit
2c00d53db2
7 changed files with 101 additions and 41 deletions
|
|
@ -363,14 +363,24 @@ IsHook(object):
|
|||
return PublicWeenieDesc.HookType != 0
|
||||
and PublicWeenieDesc.HookItemTypes != TYPE_UNDEF
|
||||
|
||||
UnpackCapacityByte(wireByte):
|
||||
# PublicWeenieDesc::UnPack uses MOVSX at 0x005AD530 and 0x005AD545.
|
||||
# The generated pseudocode's uint8_t temporary is misleading.
|
||||
return sign_extend_int8_to_int32(wireByte)
|
||||
|
||||
ShowCapacity(object, profile):
|
||||
if object is not a hook or profile does not contain a HookProfile:
|
||||
append authored item/container capacity as a new paragraph
|
||||
if profile contains PageCount (175) and PageUsed (174):
|
||||
append "<used> of <count> pages full." as a new paragraph
|
||||
|
||||
# A hook with a HookProfile describes its mounted item. Its sentinel
|
||||
# 255/255 PublicWeenieDesc capacities are not player-facing capacity.
|
||||
# A hook with a HookProfile describes its mounted item, so the hook's own
|
||||
# capacity is not player-facing capacity.
|
||||
|
||||
# Ordinary creature/NPC-lookalike templates can carry -1/-1 capacity
|
||||
# sentinels. They travel as FF/FF but UnpackCapacityByte restores -1/-1,
|
||||
# so the routine's > 0 tests emit no capacity prose. Black Phyntos Hive
|
||||
# (WCID 28249) is this case: Creature, not Hook.
|
||||
|
||||
ShowLock(object, profile):
|
||||
if object is a hook:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue