[C++][SOURCE] Auto anti yangbug

07/02/2014 03:02 deco016#1
Hey, in this topic i show you how to fix yangbugs in source.

Open Shop_Manager.cpp and find
Code:
dwPrice = item->GetShopBuyPrice();
Add after this line
Code:
if(dwPrice > item->GetGold()) 
		dwPrice=item->GetGold();
Now save and compile game.


Please do not copy to another boards. This topic is created only for elitepvpers.com
07/02/2014 04:13 Florinelus#2
Thanks bro.
07/02/2014 08:05 IgorGlock#3
I think this code creates the "bug".
07/02/2014 12:40 IgorGlock#4
IF PLAYER HAS 100 GOLD AND ITEM COSTS 200 GOLD, HE WILL BE ABLE TO BUY IT!
:( That's not funny...

@.Ammo'
u srs?
07/02/2014 13:59 .Kibito#5
To prevent the "yang bug" you have to increase the maximum value of yang.
07/02/2014 14:27 CryPrime#6
Quote:
Originally Posted by .Ammo' View Post
antispam:
nice thx for publishing
Langsam sollte man auch dafür ne Verwarnung geben (Anti Spam)

@Topic:
kann leider nicht mit Src arbeiten da ich kp habe..
07/02/2014 19:03 deco016#7
Quote:
Originally Posted by IgorGlock View Post
I think this code creates the "bug".
Why? If you have in item_proto column gold 100 and shop_buy_price 100000 then game fixing it which replace shop buy price to gold before calculating price

Code:
	DWORD dwPrice;

	if (bCount == 0 || bCount > item->GetCount())
		bCount = item->GetCount();

	dwPrice = item->GetShopBuyPrice();
	
	if(dwPrice > item->GetGold()) 
		dwPrice=item->GetGold();
	if (IS_SET(item->GetFlag(), ITEM_FLAG_COUNT_PER_1GOLD))
	{
		if (dwPrice == 0)
			dwPrice = bCount;
		else
			dwPrice = bCount / dwPrice;
	}
	else
		dwPrice *= bCount;

	dwPrice /= 5;
Quote:
Originally Posted by deluks1980 View Post
Krecik, wypierdalaj
Wypierdalaj elektrozjebie na mpcforum
08/19/2014 13:35 callmax#8
PHP Code:
int CItem::GetShopBuyPrice()
{
    return 
GetProto()->dwGold;

ich hätts ja so gemacht, da die funktion sowieso nur 1x benutzt wird
und ja igor, das würde schon jegliche yangbugs die mit kaufen/verkaufen zu tun haben unterbinden, weil wegen gold->item_proto = dann Verkaufswert & Shoppreis
08/19/2014 16:38 grαyfox#9
das ist außerdem kein bug sondern für derartige Fehler ist lediglich die Inkompetenz des jeweiligen Serverleiters schuld
08/19/2014 23:17 galetlefrancais#10
Thanks u
08/20/2014 00:38 Zonni#11
Thanks, great release :D

But useless if you have good configured item_proto :p
08/20/2014 21:22 kstmr#12
Quote:
Originally Posted by Zonni View Post
Thanks, great release :D

But useless if you have good configured item_proto :p
how does a (good configured) item proto look like?
08/20/2014 21:59 aok96boom#13
He means that the sell price isn't bigger than the buy price
08/20/2014 23:57 Zonni#14
Quote:
Originally Posted by aok96boom View Post
He means that the sell price isn't bigger than the buy price
Only in some cases - I checked only items from ingame shops.
08/21/2014 01:47 kstmr#15
well this basicly mean that this fix is useless as long as you have a good item proto
but did you know that there is a way to buy yang