Fix crash caused by panel removing itself during tick

This commit is contained in:
DBotThePony 2023-03-26 15:16:16 +07:00
parent a1fd948266
commit 7869d686f7
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -582,9 +582,9 @@ abstract class MatteryScreen<T : MatteryMenu>(menu: T, inventory: Inventory, tit
}
override fun containerTick() {
for (panel in panels) {
panel.tick()
}
val copy = ArrayList<EditablePanel<*>>(panels.size)
for (panel in panels) copy.add(panel)
for (panel in copy) panel.tick()
}
companion object {