Replaced ProbabilityObjectArray.Draw() with DrawAndRemove Draw

Reduced overhead when drawing a large number of elements during loot generation
This commit is contained in:
Chomp
2025-08-06 17:52:49 +01:00
parent 3f405fc67e
commit 6b297adf68
4 changed files with 86 additions and 48 deletions
@@ -482,7 +482,7 @@ public class InsuranceController(
}
// Draw x attachments from weighted array to remove from parent, remove from pool after being picked
var attachmentIdsToRemove = attachmentsProbabilityArray.Draw((int)countOfAttachmentsToRemove, false);
var attachmentIdsToRemove = attachmentsProbabilityArray.DrawAndRemove((int)countOfAttachmentsToRemove);
foreach (var attachmentId in attachmentIdsToRemove)
{
toDelete.Add(attachmentId);