Jump to content

Fix Cheque / Won and Gold Exchange


Asentrix

Recommended Posts

Hey all,

easy to fix but I'm releasing because I realized many of servers(and devs) have this problem

 

problem description: when you enter decimal number in Won Exchange window (like 1.5) it will be exchanged for 150,000,000 but it will remove 1 won only so you got yang more than you should get.

 

after checking some cheque systems (including WLsj24 ones)

in quests they have check like:

if ((amount < 1) or (amount >19) or (amount == nil)) then

and it's true except that check from 1 to 19 includes decimal numbers too

so if you write 1.5 it will be exchanged to 150,000,000 and only remove 1 Won

so you should put a check for INT, you can modify it to be:

if ((amount < 1) or (amount >19) or (amount == nil) or (math.floor(amount) ~= amount)) then

(if the floor of amount is equal to amount so it's INT, otherwise it's not int)

Best Regards.

Edited by Asentrix
  • Metin2 Dev 1
Link to comment
Share on other sites

41 minutes ago, TMP4 said:

They actually do since they just copy paste from tutorial. I saw several P server what came to this glitch.

The quest what contains this is official and from gayF, when they introduced cheque they had this bug too for a couple days :D

yes, and that's why I posted a fix ?

Link to comment
Share on other sites

3 hours ago, Bizzy said:

hmm when a make it like 1,5 or 1.5 nothing happend 

https://metin2.download/picture/Q06z2ZOYdVeS37u6PMOSfongXoFjBc5W/.png

your problem is clear, "attempt to compare nil with number"

if you can't solve just put the quest

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.