fix for NaN check

master
Juraj Vajda 2018-11-06 19:01:28 -05:00
parent 622113238c
commit c8904529e6
1 changed files with 4 additions and 4 deletions

View File

@ -120,8 +120,8 @@ minetest.register_chatcommand("mp", {
end
-- check for NaN, returns true if given value is not a number (NaN)
if (amount ~= amount) then
return false
if (tonumber(amount) ~= tonumber(amount)) then
return false, "Not a valid command."
end
local buy_price = amount * store_item.buy
@ -295,8 +295,8 @@ minetest.register_chatcommand("mp", {
end
-- check for NaN, returns true if given value is not a number (NaN)
if (amount ~= amount) then
return false
if (tonumber(amount) ~= tonumber(amount)) then
return false, "Not a valid command."
end
local buy_price = amount * store_item.buy