Skip to content

Commit

Permalink
change unlimited cheat to do a full stack / tank on first add.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengardner committed Dec 24, 2023
1 parent 6351c2e commit 7f739c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/GlobalState.lua
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ function M.set_item_count(item_name, count)
if infinite_supply then
local old_count = global.mod.items[item_name] or 0
if count > old_count then
local prot = game.item_prototypes[item_name]
if prot ~= nil and prot.stack_size > count then
count = prot.stack_size
end
global.mod.items[item_name] = count
end
elseif count <= 0 then
Expand All @@ -676,6 +680,9 @@ function M.set_fluid_count(fluid_name, temp, count)
if infinite_supply then
local old_count = ff[temp] or 0
if count > old_count then
if count < constants.MAX_TANK_SIZE then
count = constants.MAX_TANK_SIZE
end
ff[temp] = count
end
elseif count <= 0 then
Expand Down

0 comments on commit 7f739c4

Please sign in to comment.