danprince / norman-the-necromancer

💀 Entry for JS13k 2022
https://norman-the-necromancer.netlify.app/
The Unlicense
195 stars 30 forks source link

`undefined` ritual description at shop menu #6

Open AshSimmonds opened 1 year ago

AshSimmonds commented 1 year ago

Only seen this a couple times, on this instance it was level 9, not sure how to recreate at this stage.

Some random screenshots for reference.

MV5uCkmJ8J

w1vpi57uha

goF5dUkJy2

SeanScherer commented 1 year ago

Hmm, maybe this is an issue with the Environment (or at least, only manifests itself within a certain Dev environment?).

As mentioned elsewhere I have played a lot of hours over the last couple days, never seen this. (Could be there's certain rituals I don't buy though, and it only happens in conjunction with those? Ie, I only ever once went for "Drunkard" :P).

If you happened to remember which rituals you had, that could possibly be helpful? (P.S. You're pretty heavily maxed out on the Level ups :P !)

danprince commented 1 year ago

Pretty sure I've seen this a couple of times too, and my memory was that it happened after buying an item from the shop. Likely something to do with the logic in buy.

https://github.com/danprince/norman-the-necromancer/blob/80e60526014e0d228bc161ebdd1a2a663ad4e79b/src/shop.ts#L25

At a quick look, that code looks pretty buggy. selectShopIndex accepts a step to apply to the current index, but buy passes shop.selectedIndex instead of a step like 0.