mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user