BaseMod
BaseMod copied to clipboard
Update AddCustomMonsters.java to use deep copy
The original version may cause a potential issue that the saved custom encounters will get their weights modified each time the patched method normalizeWeights() is called. In vanilla game that happens generally only once over an act of dungeon, by calling generateWeakEnemies()/ generateStrongEnemies()/ generateElites() by calling generateMonsters(). However, some of these methods are not determined to be called only once under the modding environment. Therefore, I suggest adopting a deep copy to make sure the saved custom encounters will never be changed no matter how many times normalizeWeights() is called, which may improve explainability.