jjppof / goldensun_html5

An online Golden Sun Engine entirely built in HTML5 with Phaser 2. Check https://gshtml5.org/
https://gshtml5.org/
MIT License
170 stars 39 forks source link

Game freezes when repeatedly buying and equipping same item from shop #476

Closed SamuelPhang closed 1 year ago

SamuelPhang commented 1 year ago

broken_shop

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'equipped')
    at g.unequip_item (MainChar.ts:462:24)
    at g.equip_item (MainChar.ts:429:18)
    at e.BuyArtifactsMenu.equip_new_item (BuyArtifactsMenu.ts:203:41)
SamuelPhang commented 1 year ago

@jjppof can you explain what was causing the game to freeze? Just curious

jjppof commented 1 year ago

The implementer of the shop wasn't using the MainChar API to add and remove items, this was causing some issues with the index property of the ItemSlots. These issues, in this example, were leading to a crash when you received a game ticket.