fix for NaN check
parent
622113238c
commit
c8904529e6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue