oldschoolgg / oldschooljs

A utility library for all things oldschool runescape related.
https://docs.oldschool.gg/
MIT License
46 stars 50 forks source link

LootTable improvements (cloning, memory, allItems accuracy) #310

Open themrrobert opened 1 year ago

themrrobert commented 1 year ago

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 incorrect

This fixes those issues, and also removes the need to cache allItems which is a small memory improvement.

Changes: