Shop balance not workingNot An Issue
No, it's this one. https://umod.org/community/gui-shop/12391-what-does-shop-balance-in-the-config-do?page=1#post-1
I'm trying to see it I can pin a version number on this tail, as it's a feature some folks might be quite happy if restored.
Merged postFound it : 1.6.0.
I hate to be the bringer of bad news, but that does not do what you think it does in any way, shape, or form.
The only thing that ever did do for, example:
Say I set up shop items with 0.06 pricing.
GUIShop would auto round the digit to a whole int value based on whether it was true or false nothing more nothing less.
There is the code from that version you can see for yourself.
double GetBuyPrice(ItemData data)
{
if (!Balance || data.Fixed) return data.Buy;
return Math.Round(data.Buy * GetFactor(data), 2);
}
double GetSellPrice(ItemData data)
{
if (!Balance || data.Fixed) return data.Sell;
return Math.Round(data.Sell * GetFactor(data), 2);
}
double GetFactor(ItemData data)
{
if (data.Shortname == null) return 1;
var itemname = data.Shortname;
ulong buy;
if (!buyed.TryGetValue(itemname, out buy))
buy = 1;
ulong sell;
if (!selled.TryGetValue(itemname, out sell))
sell = 1;
return Math.Min(Math.Max(buy / (double)sell, .25), 4);
}This "Balance toggle" never needed to be a config option from the start ^
So all I did was remove it because GUIShop now handles all that logic in a much better and cleaner way.