Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed CreateStackArrayInContainer so it doesn't return error if there… #150

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading