Repository navigation
fix(vendor): a shop listing with zero stock is unlimited - #218
Open
davidc-smith wants to merge 1 commit into
Open
davidc-smith wants to merge 1 commit into
davidc-smith wants to merge 1 commit into
Conversation
ACE sends a shop create-list row's authored stack size unchanged, and world content authors many of those rows as 0 rather than -1. ACE never limits a create-list item, but the vendor window only treated a negative stock as unlimited, so it hid every zero-stock row and the vendor looked empty. Component auto-fill also capped those rows at nothing. The ApproachVendor wiring now records any non-positive stock as -1. Claude-Session: https://claude.ai/code/session_01T9gYq4uZVPNw3DPW9cnpE9
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A vendor can open with an empty item list even though it has stock. ACE sends each listing's stock exactly as the content authored it. Much ACE world content authors shop rows with a stack size of
0rather than-1, and ACE sends that0unchanged. The vendor window treated only a negative stock as unlimited, so it read0as sold out and hid the row. A vendor whose rows are all0showed nothing.The
ApproachVendorwiring now records any stock of 0 or below as-1(unlimited) when it buildsVendorShopItem. That one change fixes:VendorUiController.AvailableShopQuantity)VendorComponentFill.TryFindStock)VendorApproachstill reports the stock exactly as it came over the wire. A new test,RuntimeVendorLifecycleTests.ApproachVendorEvent_ZeroStockListing_IsUnlimited, dispatches listings with stock 0, -1 and 3 and checks they come out as -1, -1 and 3.How it was tested
Live, on the Infinite Leaftide ACE server: before the fix, the vendor Aydra the Redistributor opened with an empty item list. With the fix, his inventory is visible.
Original behavior
ACE (
Vendor.LoadInventoryItem) keeps the create-list row's stack size and only turns a missing value into -1. When a player buys one of those standard items, ACE never checks that stack size, so0and-1both mean the vendor never runs out. Items a player has sold to the vendor carry their real stack size, which is always at least 1, so a real count is never 0. ACE world content that uses0stocks normally for players on the retail client.Checklist
dotnet build AcDream.slnx -c Releaseis greenhttps://claude.ai/code/session_01T9gYq4uZVPNw3DPW9cnpE9