fix: a vendor sells up to 999 of an item at once

The limit was 1000. The client's buy dialog counts up to 999 for an
item from a vendor, whatever the item's stack size is, so that is the
most a purchase can ask for.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 15:37:08 -06:00
parent 5ff45d9a90
commit b3f5cd74df
2 changed files with 3 additions and 3 deletions

View File

@@ -5,8 +5,8 @@
#include <cstdint>
namespace VendorPricing {
// The most of one item a vendor sells at once, a full stack is 999
constexpr uint32_t MaxBuyCount = 1000;
// The most of one item a vendor sells at once, the count the client's buy dialog stops at
constexpr uint32_t MaxBuyCount = 999;
/**
* Whether a count a player asked to move out of a stack is one the stack can give

View File

@@ -18,7 +18,7 @@ TEST(VendorPricingTest, AVendorSellsUpToAFullStackAtOnce) {
EXPECT_TRUE(VendorPricing::IsValidBuyCount(1));
EXPECT_TRUE(VendorPricing::IsValidBuyCount(999));
EXPECT_FALSE(VendorPricing::IsValidBuyCount(0));
EXPECT_FALSE(VendorPricing::IsValidBuyCount(1001));
EXPECT_FALSE(VendorPricing::IsValidBuyCount(1000));
// What a negative count becomes
EXPECT_FALSE(VendorPricing::IsValidBuyCount(static_cast<uint32_t>(-1)));
}