From b3f5cd74df9b00241840c839c4d2c9014fa85d29 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 10 Nov 2026 15:37:08 -0600 Subject: [PATCH] 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 --- dGame/dUtilities/VendorPricing.h | 4 ++-- tests/dGameTests/dGameMessagesTests/VendorPricingTests.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dGame/dUtilities/VendorPricing.h b/dGame/dUtilities/VendorPricing.h index a6471e501..23b9e5294 100644 --- a/dGame/dUtilities/VendorPricing.h +++ b/dGame/dUtilities/VendorPricing.h @@ -5,8 +5,8 @@ #include 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 diff --git a/tests/dGameTests/dGameMessagesTests/VendorPricingTests.cpp b/tests/dGameTests/dGameMessagesTests/VendorPricingTests.cpp index eee02d0c2..28c2f9790 100644 --- a/tests/dGameTests/dGameMessagesTests/VendorPricingTests.cpp +++ b/tests/dGameTests/dGameMessagesTests/VendorPricingTests.cpp @@ -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(-1))); }