Jump to content

[HOTFIX] Bug Won


Goddino

Recommended Posts

Hi community!

I decided to write this topic because a friend of mine contacted me a little while ago informing me of a recently discovered bug with won that affects several private servers

If you write "1.999" in the section "Won -> Yang" you will receive 199kk, about the double of its real value

On my server the problem would have been much bigger as the won is worth 1kkk

I'll post a hotfix that I did on the fly and it worked:

Go to the server, in the quest path, open the won.lua quest

Look for the following statement:

local amount = input()

is located in the first lines of the quest, under this instruction add the following:

if string.find(amount, ".") then
    syschat("No punctuation marks allowed")
    return
end

Code translation:

Check if there is a period in the string that the user entered (the player in our case)

If the dot is present, end the quest by printing the message "No punctuation marks allowed"

The bug could be fixed in many ways even more effective than this, but for something "on the fly" I give you this hotfix 😉

  • Good 2
Link to comment
Share on other sites

local inputPrice = tonumber(string.gsub(input(), "[^0-9]", ""))
local realPrice = math.floor(inputPrice)

There is no logic explanation for the math.floor since you only let people write numbers but you can let that be there just in case.

As long as I'll be a threat for you , i will always be your target :3

Link to comment
Share on other sites

  • 4 months later...
Guest Anonymous
On 5/13/2021 at 11:02 AM, Goddino said:

Hi community!

I decided to write this topic because a friend of mine contacted me a little while ago informing me of a recently discovered bug with won that affects several private servers

If you write "1.999" in the section "Won -> Yang" you will receive 199kk, about the double of its real value

On my server the problem would have been much bigger as the won is worth 1kkk

I'll post a hotfix that I did on the fly and it worked:

Go to the server, in the quest path, open the won.lua quest

Look for the following statement:

local amount = input()

is located in the first lines of the quest, under this instruction add the following:

if string.find(amount, ".") then
    syschat("No punctuation marks allowed")
    return
end

Code translation:

Check if there is a period in the string that the user entered (the player in our case)

If the dot is present, end the quest by printing the message "No punctuation marks allowed"

The bug could be fixed in many ways even more effective than this, but for something "on the fly" I give you this hotfix 😉

This does not work as intended.

Link to comment
Share on other sites

  • Premium

This is a copy paste message from stack.

"If it's okay to accept a string that contains a number, tonumber(foo) will work, and will actually convert it to a "number" value internally. But if you need to know whether Lua considers it an actual number or not, rather than a string, use 'number' == type(foo) in your test conditions."

Link to comment
Share on other sites

Announcements



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.