Open themrrobert opened 1 year ago
Fixes issues where LootTable.clone() doesn't actually deep-clone, so if you want to make adjustments to LootTables, it's a much trickier prospect.
Also, if a sub-table changes after it's add()'d then the LootTable.allItems will be incorrect
add()
This fixes those issues, and also removes the need to cache allItems which is a small memory improvement.
allItems is now a getter, so that it is always accurate.
allItems
LootTable.clone() now properly clones the LootTable
Added unit tests
[x] I have tested all my changes thoroughly.
Description:
Fixes issues where LootTable.clone() doesn't actually deep-clone, so if you want to make adjustments to LootTables, it's a much trickier prospect.
Also, if a sub-table changes after it's
add()
'd then the LootTable.allItems will be incorrectThis fixes those issues, and also removes the need to cache allItems which is a small memory improvement.
Changes:
allItems
is now a getter, so that it is always accurate.LootTable.clone() now properly clones the LootTable
Added unit tests
[x] I have tested all my changes thoroughly.