Fixed a bug with random events where untradeables in inventory would be deleted

This commit is contained in:
Ceikry 2022-03-30 22:46:42 +00:00 committed by Ryan
parent 4a022d1d78
commit fec2fe5a28

View file

@ -87,7 +87,7 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
fun noteAndTeleport() { fun noteAndTeleport() {
for (item in player.inventory.toArray()) { for (item in player.inventory.toArray()) {
if (item == null) continue if (item == null) continue
if (item.noteChange != item.id) { if (item.noteChange != item.id && item.noteChange != -1) {
player.inventory.remove(item) player.inventory.remove(item)
player.inventory.add(Item(item.noteChange, item.amount)) player.inventory.add(Item(item.noteChange, item.amount))
} }