forge icon indicating copy to clipboard operation
forge copied to clipboard

Volrath's Shapeshifter with Triskelion as topmost card of graveyard causes stack overflow

Open jumpinjackie opened this issue 1 year ago • 4 comments

Describe the bug

If you resolve a Volrath's Shapeshifter and the topmost card of your graveyard is a Triskelion, the game will stack overflow and the game log is spammed with Volrath's Shapeshifter (as Triskelion?) coming into play with 3 +1/+1 counters over and over.

To Reproduce

  1. Get Triskelion into your graveyard
  2. Resolve a Volrath's Shapeshifter with Triskelion as the topmost card in your GY

Expected behavior

Volrath's Shapeshifter comes into play as a copy of Triskelion with 3 +1/+1 counters

Screenshots

2024-02-21 22_07_24-Forge_ 1 6 60-SNAPSHOT

Copy of the stack trace from the crash dialog attached as well

stacktrace.txt

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser N/A
  • Version 1.6.60-SNAPSHOT-02-20

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

jumpinjackie avatar Feb 21 '24 11:02 jumpinjackie

@tool4ever the Problem is the CloneState Replacement Effect getting copied. also the Special check for if the ReplacementEffect has already been run for etb ones uses special logic for ones gained by StaticAbilities

maybe that helps to pinpoint the problem?

Hanmac avatar Feb 21 '24 12:02 Hanmac

@Hanmac I have it almost fixed like this: image

But I think there is another logic error in the GainTextOf$ logic: currently it would add the RE twice

  • once from the etbCounter into changedCardKeywordsByText
  • and another via state.getReplacementEffects() into ChangedCardTraitsByText

this results in it getting double the counters

how can we prevent that? 🤔

tool4ever avatar Feb 21 '24 20:02 tool4ever

CloneText should probably only copy the Intrinsic Replacement Effects (the ones directly in state)

But I need to debug it

Hanmac avatar Feb 21 '24 20:02 Hanmac

This issue has not been updated in a while and has now been marked as stale. Stale messages will be auto closed.

github-actions[bot] avatar Mar 23 '24 09:03 github-actions[bot]