Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Duel.GetFieldGroupCount #602

Merged
merged 2 commits into from
Jun 18, 2024
Merged

fix Duel.GetFieldGroupCount #602

merged 2 commits into from
Jun 18, 2024

Conversation

salix5
Copy link
Collaborator

@salix5 salix5 commented Jun 15, 2024

Problem

Duel.GetFieldGroupCount(tp,LOCATION_SZONE+LOCATION_FZONE,0)
It will count the same card twice.
If A has 1 Field Spell and 1 Continuous Spell:
Correct: 2
Now: 3

Reason

Duel.GetFieldGroup(tp,LOCATION_SZONE+LOCATION_FZONE,0)
It will put the cards in a set.

Duel.GetFieldGroupCount(tp,LOCATION_SZONE+LOCATION_FZONE,0)
It will not put the cards in a set.

Solution

use set in filter_matching_card, filter_field_card

Test

Add the following to the operation function of any Continuous Spell X:

Debug.Message(Duel.GetFieldGroupCount(tp,LOCATION_SZONE+LOCATION_FZONE,0))
Debug.Message(Duel.IsExistingMatchingCard(nil,tp,LOCATION_SZONE+LOCATION_FZONE,0,3,nil))

Activate a Field Spell
Acticate X

The result is

3
true

in current version.

@mercury233
@purerosefallen

@salix5 salix5 added next and removed next labels Jun 15, 2024
@salix5 salix5 merged commit cbca8ce into master Jun 18, 2024
1 check passed
@salix5 salix5 deleted the patch-filter-card branch June 18, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant