Fix for meso exploit with shops
I usually don't share fixes with the public anymore, only with Lai, though he has fixed most of the exploits I find already. :D: Anyways, decided to release the fix for this one because the guys who did it on my server yesterday are fags and they don't deserve to be able to exploit, not even on Soul's servers. I assume this works on most servers because I haven't seen this fixed in any public sources.
MapleShop.java
Code:
if (c.getPlayer().getMeso() >= item.getPrice() * quantity) {
Change that to either
Code:
if (c.getPlayer().getMeso() >= (long) item.getPrice() * quantity) {
or (I suggest to use this method, otherwise you will also have to check for the quantity not being negative.)
Code:
int price = item.getPrice() * quantity;
if (price >= 0 && c.getPlayer().getMeso() >= price) {
to prevent overflow.
Re: Fix for meso exploit with shops
Re: Fix for meso exploit with shops
nice release, btw, isn't it supposed to be
Code:
int price = item.getPrice() * quantity;
if (price >= 0 && c.getPlayer().getMeso() >= price) {
If meso > price and not >=, players will not be able to buy any items although their meso is same price as items
Re: Fix for meso exploit with shops
Of course, just a typo. :) Fixed.
Re: Fix for meso exploit with shops
well done flav. Even though thats fixed by most unstupid coders :D.
Re: Fix for meso exploit with shops
^ So you're saying flav was stupid for not fixing it earlier?
Re: Fix for meso exploit with shops
I bet he fixed it earlier. He just now released it boy :)
Re: Fix for meso exploit with shops
The reason for the rollback...
Anyways thanks for sharing it with us.
Re: Fix for meso exploit with shops
Quote:
Originally Posted by
Xerixe
^ So you're saying flav was stupid for not fixing it earlier?
This made me giggle. Careful what you say, The almighty eye is watching.
OT: Thanks Flav, Nice Release.
---------- Post added at 06:15 PM ---------- Previous post was at 06:14 PM ----------
Quote:
Originally Posted by
nugyyman
The reason for the rollback...
Anyways thanks for sharing it with us.
lolwut?
Re: Fix for meso exploit with shops
Quote:
Originally Posted by
maxcloud
This made me giggle. Careful what you say, The almighty eye is watching.
OT: Thanks Flav, Nice Release.
---------- Post added at 06:15 PM ---------- Previous post was at 06:14 PM ----------
lolwut?
almighty eye...., you mean your whispering-eye :X
OT : nice XD
Re: Fix for meso exploit with shops
Quote:
Originally Posted by
xReflex
well done flav. Even though thats fixed by most unstupid coders :D.
You can't fix something you don't know "exist".
Re: Fix for meso exploit with shops
Let's not turn this into some pathetic argument over who is better at what... Stick to the topic.
Re: Fix for meso exploit with shops
Code:
if (item != null && item.getPrice() > 0) {
if (c.getPlayer().getMeso() >= item.getPrice() * quantity) {
Wouldn't this also work? Found it in my source.
Re: Fix for meso exploit with shops
Quote:
Originally Posted by
SeanDev
Code:
if (item != null && item.getPrice() > 0) {
if (c.getPlayer().getMeso() >= item.getPrice() * quantity) {
Wouldn't this also work? Found it in my source.
The problem is that if you buy so many of the item that the the price goes higher than Integer.MAX_VALUE (2,147,483,647) it goes negative again, then the player surely has more mesos than the price is. Then he gets the items and doesn't lose but gains the money he should pay.
Re: Fix for meso exploit with shops
Quote:
Originally Posted by
flav
The problem is that if you buy so many of the item that the the price goes higher than Integer.MAX_VALUE (2,147,483,647) it goes negative again, then the player surely has more mesos than the price is. Then he gets the items and doesn't lose but gains the money he should pay.
Correct me if I'm wrong, but doesn't the price > 0 thing fix that?
Wait I feel stupid.