fix shop overflow

master
ac-minetest 2020-02-19 23:08:42 +01:00
parent e2fa031ad4
commit 5e7fc128f2
1 changed files with 5 additions and 2 deletions

View File

@ -467,9 +467,12 @@ minetest.register_chatcommand("sell", {
if not count then count = stack:get_count() else count = tonumber(count) or 1 end
if count<1 then count = 1 end
if not total_count then total_count = count else total_count = tonumber(total_count) or count end
if total_count<count then total_count = count end;
if count>64000 then count = 64000 end -- overflow check
if total_count<count then total_count = count end;
if total_count>64000 then total_count = 64000 end
if itemname == "" then return end
local shop_count = (player_shops[name] or 0)+1;