db0 / godot-card-game-framework

A framework which comes with prepared scenes and classes to kickstart your card game, as well as a powerful scripting engine to use to provide full rules enforcement.
http://dbzer0.com/projects/godot-card-game-framework/
GNU Affero General Public License v3.0
947 stars 100 forks source link

When having multiple hand on the board, card rotation not calculated. #142

Closed fengjiongmax closed 3 years ago

fengjiongmax commented 3 years ago

In a scene have two sets of deck, hand, discard. Like this: image And then everything is set up correctly, like draw card from OpponentDeck will draw a card to OpponentHand.

But after a card draw from OpponentDeck, cards in OpponentHand do not rotate, as shown in this gif: card_rotate I've created a branch to reproduce this:https://github.com/fengjiongmax/godot-card-game-framework/tree/multiple-hand-debug

After digging into the code, I think the line causing this is: https://github.com/db0/godot-card-game-framework/blob/2d20e268ddaaba844a9ba761b6f82740589979f0/src/core/CardTemplate.gd#L2498

I guess this can be solved by replacing get_parent() == cfc.NMAP.hand with get_parent().is_in_group("hand").

db0 commented 3 years ago

Yeah that looks like it's the issue for sure :)