Skip to content

Commit

Permalink
Fixed CreateStackArrayInContainer so it doesn't return error if there…
Browse files Browse the repository at this point in the history
… is none.
  • Loading branch information
Reloecc committed Mar 23, 2024
1 parent 214a3ce commit b4d5b38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/include/std.inc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ function CreateStackArrayInContainer (container, objtype, amount, limit_per_stac
for loops := 1 to (amount/limit_per_stack)
result.append(CreateItemInContainer(container, objtype, limit_per_stack));
endfor
result.append(CreateItemInContainer(container, objtype, amount-(amount/limit_per_stack)*limit_per_stack));
var remainder := amount-(amount/limit_per_stack)*limit_per_stack;
if (remainder > 0)
result.append(CreateItemInContainer(container, objtype, remainder));
endif
return result;
endfunction

Expand Down

0 comments on commit b4d5b38

Please sign in to comment.