Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
ygopro-core
Commits
f14f7819
Commit
f14f7819
authored
Sep 01, 2022
by
Chrono-Genex
Committed by
GitHub
Sep 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Card.IsPreviousSetCard (#455)
parent
71b4c40b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
12 deletions
+36
-12
card.cpp
card.cpp
+29
-6
card.h
card.h
+3
-2
operations.cpp
operations.cpp
+4
-4
No files found.
card.cpp
View file @
f14f7819
...
...
@@ -28,6 +28,28 @@ bool card_state::is_location(int32 loc) const {
return
true
;
return
false
;
}
void
card_state
::
init_state
()
{
code
=
0xffffffff
;
code2
=
0xffffffff
;
type
=
0xffffffff
;
level
=
0xffffffff
;
rank
=
0xffffffff
;
link
=
0xffffffff
;
lscale
=
0xffffffff
;
rscale
=
0xffffffff
;
attribute
=
0xffffffff
;
race
=
0xffffffff
;
attack
=
0xffffffff
;
defense
=
0xffffffff
;
base_attack
=
0xffffffff
;
base_defense
=
0xffffffff
;
controler
=
0xff
;
location
=
0xff
;
sequence
=
0xff
;
position
=
0xff
;
reason
=
0xffffffff
;
reason_player
=
0xff
;
}
bool
card
::
card_operation_sort
(
card
*
c1
,
card
*
c2
)
{
duel
*
pduel
=
c1
->
pduel
;
int32
cp1
=
c1
->
overlay_target
?
c1
->
overlay_target
->
current
.
controler
:
c1
->
current
.
controler
;
...
...
@@ -87,9 +109,9 @@ card::card(duel* pd) {
equiping_target
=
0
;
pre_equip_target
=
0
;
overlay_target
=
0
;
std
::
memset
(
&
current
,
0
,
sizeof
(
card_state
))
;
std
::
memset
(
&
previous
,
0
,
sizeof
(
card_state
))
;
std
::
memset
(
&
temp
,
0xff
,
sizeof
(
card_state
)
);
current
=
{}
;
previous
=
{}
;
temp
.
init_state
(
);
unique_pos
[
0
]
=
unique_pos
[
1
]
=
0
;
spsummon_counter
[
0
]
=
spsummon_counter
[
1
]
=
0
;
unique_code
=
0
;
...
...
@@ -376,9 +398,10 @@ int32 card::is_pre_set_card(uint32 set_code) {
setcode
=
setcode
>>
16
;
}
//add set code
setcode
=
previous
.
setcode
;
if
(
setcode
&&
(
setcode
&
0xfff
)
==
settype
&&
(
setcode
&
0xf000
&
setsubtype
)
==
setsubtype
)
return
TRUE
;
for
(
auto
&
presetcode
:
previous
.
setcode
)
{
if
(
presetcode
&&
(
presetcode
&
0xfff
)
==
settype
&&
(
presetcode
&
0xf000
&
setsubtype
)
==
setsubtype
)
return
TRUE
;
}
//another code
uint32
code2
=
previous
.
code2
;
uint64
setcode2
;
...
...
card.h
View file @
f14f7819
...
...
@@ -41,12 +41,12 @@ struct card_data {
struct
card_state
{
card_state
()
:
code
(
0
),
code2
(
0
),
setcode
(
0
),
type
(
0
),
level
(
0
),
rank
(
0
),
link
(
0
),
lscale
(
0
),
rscale
(
0
),
attribute
(
0
),
race
(
0
),
attack
(
0
),
defense
(
0
),
base_attack
(
0
),
base_defense
(
0
),
:
code
(
0
),
code2
(
0
),
type
(
0
),
level
(
0
),
rank
(
0
),
link
(
0
),
lscale
(
0
),
rscale
(
0
),
attribute
(
0
),
race
(
0
),
attack
(
0
),
defense
(
0
),
base_attack
(
0
),
base_defense
(
0
),
controler
(
PLAYER_NONE
),
location
(
0
),
sequence
(
0
),
position
(
0
),
reason
(
0
),
pzone
(
false
),
reason_card
(
nullptr
),
reason_player
(
PLAYER_NONE
),
reason_effect
(
nullptr
)
{}
uint32
code
;
uint32
code2
;
uint16
setcode
;
std
::
vector
<
uint32
>
setcode
;
uint32
type
;
uint32
level
;
uint32
rank
;
...
...
@@ -69,6 +69,7 @@ struct card_state {
uint8
reason_player
;
effect
*
reason_effect
;
bool
is_location
(
int32
loc
)
const
;
void
init_state
();
};
struct
query_cache
{
...
...
operations.cpp
View file @
f14f7819
...
...
@@ -3865,12 +3865,12 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pcard
->
previous
.
attack
=
pcard
->
data
.
attack
;
pcard
->
previous
.
defense
=
pcard
->
data
.
defense
;
}
pcard
->
previous
.
setcode
.
clear
();
effect_set
eset
;
pcard
->
filter_effect
(
EFFECT_ADD_SETCODE
,
&
eset
);
if
(
eset
.
size
())
pcard
->
previous
.
setcode
=
eset
.
get_last
()
->
get_value
(
pcard
);
else
pcard
->
previous
.
setcode
=
0
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pcard
->
previous
.
setcode
.
push_back
((
uint32
)
eset
[
i
]
->
get_value
(
pcard
));
}
}
}
if
(
leave_p
.
size
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment