open-duelyst / duelyst

Duelyst is a digital collectible card game and turn-based strategy hybrid, developed by Counterplay Games.
Creative Commons Zero v1.0 Universal
3.61k stars 555 forks source link

[P0] Importing a decklist doesnt delete your previous deck/general. Many bugs happen as a result. #255

Closed Ein666 closed 1 year ago

Ein666 commented 1 year ago

Summary

When creating a new deck with a general and cards in it you can import a deck with a deckcode containing another General and end up 2 Generals and over 40 cards in your deck.

This has multiple knock-on-effects that add game-breaking bugs like having your bloodbound spell triggering in the corner of the screen rather than around your main general since the second one spawns offscreen.

Steps to reproduce

  1. Create a Duelyst Deck with a general (for example Ragnora the Relentless)
  2. Import a decklist with another general of the same faction (for example the decklist below)

MTo0MDEsMjo0MDUsMzo0MTIsMzo0MzMsMjo0MzYsMzo0MzcsMjoxMDk3NSwyOjEwOTgxLDM6MTExMTUsMjoxMTEyMSwzOjE5MDUyLDI6MjAxMTIsMjoyMDExNywyOjIwMTIyLDM6MjAxMjUsMzoyMDE1NywyOjIwMjE4

  1. Congratulations, you now have over 40 cards in your deck including 2 generals and playing the game will result in bizarre problems such as:
    • Rendering the second general offscreen so your opponent cannot win after killing your main one.
    • Replacing a card in your hand with your deck will freeze the client
    • Bloodbound spells will only trigger on your off-screen general

Environment information

Additional context

Duelyst_ToesBjsS64 Duelyst_hRSN7Zg0SP

willroberts commented 1 year ago

Let's see if we can simply hide the Import/Export buttons when a deck is being created or edited. I had only tested this from the main collection page 😅

willroberts commented 1 year ago

Relevant buttons: https://github.com/willroberts/duelyst/blob/73299eda0cfa02a18ceaff3c7c6905a6016bf728/app/ui/views2/collection/collection.js#L62L63

Example of hiding the button: https://github.com/willroberts/duelyst/blob/73299eda0cfa02a18ceaff3c7c6905a6016bf728/app/ui/views2/collection/collection.js#L827