otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.58k stars 1.05k forks source link

[bugfix] fixes bug when player asks to withdraw a string ex; "withdraw" "x" #4732

Closed Coldensjo closed 4 months ago

Coldensjo commented 4 months ago

If you say "withdraw" "asjdhajsdhajsd" to the banker you will get this error. This PR should fix it.

Jun 04 07:29:31 Ironcore gdb[1007034]: Lua Script Error: [Npc interface] Jun 04 07:29:31 Ironcore gdb[1007034]: data/npc/scripts/Suzy.lua:onCreatureSay Jun 04 07:29:31 Ironcore gdb[1007034]: data/npc/lib/npc.lua:122: bad argument https://github.com/otland/forgottenserver/pull/1 to 'sub' (number expected, got nil) Jun 04 07:29:31 Ironcore gdb[1007034]: stack traceback: Jun 04 07:29:31 Ironcore gdb[1007034]: [C]: at 0x55555560ff80 Jun 04 07:29:31 Ironcore gdb[1007034]: [C]: in function 'sub' Jun 04 07:29:31 Ironcore gdb[1007034]: data/npc/lib/npc.lua:122: in function 'getMoneyCount' Jun 04 07:29:31 Ironcore gdb[1007034]: data/npc/scripts/Suzy.lua:140: in function 'callback' Jun 04 07:29:31 Ironcore gdb[1007034]: data/npc/lib/npcsystem/npchandler.lua:413: in function 'onCreatureSay' Jun 04 07:29:31 Ironcore gdb[1007034]: data/npc/scripts/Suzy.lua:10: in function <data/npc/scripts/Suzy.lua:10>

EPuncker commented 4 months ago

yo lets stick to tabs for Lua files indentation please 😄