hearthbreaker icon indicating copy to clipboard operation
hearthbreaker copied to clipboard

'NoneType' object has no attribute 'is_valid'

Open Ragowit opened this issue 9 years ago • 2 comments

Tried to add the replay function into my AI fork. This is an error I got, but I don't know if I messed something up or if it's a real error in HearthBreaker since I have never seen this error message before.

https://gist.github.com/Ragowit/5f53106a2cfe2ed2a58f

Ragowit avatar Apr 24 '15 19:04 Ragowit

The bug in the replay file is that the game plays Shattered Sun Cleric, but no target is set in the replay so it targets None, which generates the error.

Ragowit avatar Jun 21 '15 08:06 Ragowit

The replay records the play from the event "card_played", but no target has been made by this point. A current_target for the minion card is set in the card.use() function after the trigger of the event.

Ragowit avatar Jun 21 '15 09:06 Ragowit