Skip to content

feat: return removed item when removing from weighted container#476

Merged
LordMidas merged 1 commit intodevelopmentfrom
feat-return-removed-item-from-weighted-container
Dec 13, 2025
Merged

feat: return removed item when removing from weighted container#476
LordMidas merged 1 commit intodevelopmentfrom
feat-return-removed-item-from-weighted-container

Conversation

@LordMidas
Copy link
Copy Markdown
Member

@LordMidas LordMidas commented Nov 16, 2025

Seems like a pretty straightforward feature to have and is consistent with array.remove and delete for table slots.

Allows to do the following to roll items from a container while removing them so they cannot be rolled more than once:

local item1 = weightedContainer.remove(weightedContainer.roll());
local item2 = weightedContainer.remove(weightedContainer.roll());

instead of

local item1 = weightedContainer.roll();
weightedContainer.remove(item1);
local item2 = weightedContainer.roll();

@LordMidas LordMidas requested a review from TaroEld November 16, 2025 04:05
@LordMidas LordMidas merged commit 424b8d7 into development Dec 13, 2025
@LordMidas LordMidas deleted the feat-return-removed-item-from-weighted-container branch December 13, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants