zz1000zz / OCTGN_TF

OCTGN Patch for the Transformers TCG
2 stars 2 forks source link

Error: Empty deck #31

Open hen opened 4 years ago

hen commented 4 years ago

I was attacking and ran out of cards in my deck. I got this error:

Traceback (most recent call last): File "", line 1, in File "C:\Users\hen\AppData\Local\Programs\OCTGN\Data\GameDatabase\f44befce-4d6d-4fb9-a286-9585f36aece9\scripts\actions.py", line 192, in flipMany File "", line 257, in getitem SystemError: Object reference not set to an instance of an object.

flipMany(Pile(16842754, 'Deck', Player(1)))

zz1000zz commented 4 years ago

This looks like a cornercase the code doesn't handle properly. Can you provide any additional information about the situation, specifically in how it was different than most cases where you don't get this error?

hen commented 4 years ago

I use Flip X via the mouse.

I was attacking out at the end of turn, so I'd done Flip X 3 or 4 times. Lots of cards on the battlefield. I had a Heat of Battle iirc, so was flipping ~6 at a time.

zz1000zz commented 4 years ago

I think I misunderstood what you meant. I assumed you meant you ran out of cards and needed to reshuffle, but it looks like you meant you ran out of cards in your deck and had no cards in your Scrap either. Is that correct?

If so, code has been added to make the script fail silently when no cards can be flipped. May not an ideal solution, but I'm not sure how to incorporate proper checking.