Rotwood-Vale / Ratwood-Keep

GNU Affero General Public License v3.0
12 stars 77 forks source link

[BUG] Merchant's GOLDFACE console overcharging #46

Open deep-fried-faceplant opened 3 weeks ago

deep-fried-faceplant commented 3 weeks ago

Describe the bug

When buying things from the GOLDFACE, occasionally it charges more than the listed price. For instance, a chainmaile shirt was 33 mammon. I put in 50 mammon, then bought it. It charged me 49 mammon instead, leaving only 1 mammon left. I expect the price I see on the console to be what I pay.

Round ID:

Jewel50-01.06.52

Steps to Reproduce:

Just try to buy stuff from the GOLDFACE, and count how many coins it charges compared to how many it is listed for. Occasionally, even when the exact amount is in, it will deny the purchase, which I suspect to be it attempting to charge more.

Additional context

deep-fried-faceplant commented 3 weeks ago

Tested this a few times: Sometimes it undercharges as well. An item worth 16 was instead sold to me for 14.

Alanii commented 1 week ago

For your awareness. Prices dicated in the GOLDFACE is their default price set for the round. They fluctuate based on the tax rate the King or Steward have set.

If taxes are low, sometimes you only pay X amount of money over Y. If taxes are high, purchasing an item that is 6 mammon will instead charge 15.

The problem is the GOLDFACE price number does not change on tax rates. It calculates taxes when you purchase.

deep-fried-faceplant commented 1 week ago

Already checked, it's not related to taxes. The amount charged fluctuates above and below the listed price on the Goldface, even while taxes are constant.

Because of this bug, it's possible to game the Goldface for cheaper prices by putting in less coin than the listed price, then spamming buy until it rolls a lower price. The bounds of the unlisted price seems to be based on a percentage of the listed price, around ±20%. This makes some of the more expensive items notably cheaper.

Azarak commented 6 days ago

It randomizes the random 7% value every time you try and make a purchase, so it does in fact fluctuate in +-14%

Azarak commented 5 days ago

A fix is included in https://github.com/Rotwood-Vale/Ratwood-Keep/pull/205