-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #3951 Bank NPC transfer errors #3955
Conversation
@@ -233,6 +233,12 @@ local function creatureSayCallback(cid, type, msg) | |||
end | |||
end | |||
elseif npcHandler.topic[cid] == topicList.TRANSFER_PLAYER_GOLD then | |||
local currencyValue = tonumber(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better off making sure getMoneyCount
returns a numeric value that is acceptable rather than adding checks like this (which may be required in other places as well).
@@ -248,6 +254,11 @@ local function creatureSayCallback(cid, type, msg) | |||
end | |||
elseif npcHandler.topic[cid] == topicList.TRANSFER_PLAYER_WHO then | |||
transfer[cid] = getPlayerDatabaseInfo(msg) | |||
if not transfer[cid] then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to add this if-statement to L210 as well as removing the redundant if transfer[cid] then
in both places.
Can check that way @Znote? https://pastebin.com/raw/zKNLKi7z |
I'm sure there is lots of refactoring and improvements to be made to NPC scripts and the associated lib functions, but this PR specifically is made to resolve 2 errors currently present within the bank NPC. I'm not in the mood for refactoring, but feel free to push commits to the bankfix branch on Znote/forgottenserver to help me with improvements and further fixes.
That code does not resolve the first error specified in my changes proposed list. |
Excuse my ignorance, but I don't know how to create a complete file review, nor a new pull request ... I believe that this way would solve all the checks of the function getMoneyCount() |
Fixes otland#3951 (cherry picked from commit 11fac4c)
Pull Request Prelude
Changes Proposed
Resolves 2 errors in bank NPC when trying to transfer money to another player.
Issues addressed:
#3951