[x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.
Changes Proposed
A bank NPC overflow protection was added back in https://github.com/otland/forgottenserver/pull/3522. However (at least with the current LuaJIT version, haven't tested others), tonumber is reserved for (and interpreted as) a standard library basic function.
This change simply renames the variable to avoid the conflict.
As a side note, when testing this (even when the check was being bypassed), I was never able to reproduce any crash, if I said "deposit [number larger than 2^32]" while having that amount of gold in my inventory, the NPC correctly allowed me to deposit & withdraw those amounts. Perhaps the check needs to be removed completly.
Pull Request Prelude
Changes Proposed
A bank NPC overflow protection was added back in https://github.com/otland/forgottenserver/pull/3522. However (at least with the current LuaJIT version, haven't tested others),
tonumber
is reserved for (and interpreted as) a standard library basic function.This change simply renames the variable to avoid the conflict.
As a side note, when testing this (even when the check was being bypassed), I was never able to reproduce any crash, if I said "deposit [number larger than 2^32]" while having that amount of gold in my inventory, the NPC correctly allowed me to deposit & withdraw those amounts. Perhaps the check needs to be removed completly.