Skip to content

Commit

Permalink
Merge pull request #150 from Reloecc/fix/CreateStackArrayInContainer
Browse files Browse the repository at this point in the history
Fixed CreateStackArrayInContainer so it doesn't return error if there…
  • Loading branch information
Admin-Yukiko authored Mar 24, 2024
2 parents 214a3ce + b4d5b38 commit 55a8381
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 55a8381

Please sign in to comment.