Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
赤子奈落
ygopro
Commits
7e1c4b75
Commit
7e1c4b75
authored
Dec 03, 2024
by
Chen Bill
Committed by
GitHub
Dec 03, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check second_code in is_declarable() (#2625)
parent
298b43a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
gframe/client_field.cpp
gframe/client_field.cpp
+7
-7
gframe/client_field.h
gframe/client_field.h
+1
-3
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-1
No files found.
gframe/client_field.cpp
View file @
7e1c4b75
...
...
@@ -1397,8 +1397,7 @@ bool ClientField::check_sum_trib(std::set<ClientCard*>::const_iterator index, st
||
check_sum_trib
(
index
,
end
,
acc
+
l2
)
||
check_sum_trib
(
index
,
end
,
acc
);
}
template
<
class
T
>
static
bool
is_declarable
(
T
const
&
cd
,
const
std
::
vector
<
int
>&
opcode
)
{
static
bool
is_declarable
(
const
CardData
&
cd
,
const
std
::
vector
<
unsigned
int
>&
opcode
)
{
std
::
stack
<
int
>
stack
;
for
(
auto
it
=
opcode
.
begin
();
it
!=
opcode
.
end
();
++
it
)
{
switch
(
*
it
)
{
...
...
@@ -1448,7 +1447,7 @@ static bool is_declarable(T const& cd, const std::vector<int>& opcode) {
stack
.
pop
();
int
lhs
=
stack
.
top
();
stack
.
pop
();
stack
.
push
(
lhs
&&
rhs
);
stack
.
push
(
static_cast
<
int
>
(
lhs
&&
rhs
)
);
}
break
;
}
...
...
@@ -1458,7 +1457,7 @@ static bool is_declarable(T const& cd, const std::vector<int>& opcode) {
stack
.
pop
();
int
lhs
=
stack
.
top
();
stack
.
pop
();
stack
.
push
(
lhs
||
rhs
);
stack
.
push
(
static_cast
<
int
>
(
lhs
||
rhs
)
);
}
break
;
}
...
...
@@ -1474,7 +1473,7 @@ static bool is_declarable(T const& cd, const std::vector<int>& opcode) {
if
(
stack
.
size
()
>=
1
)
{
int
val
=
stack
.
top
();
stack
.
pop
();
stack
.
push
(
!
val
);
stack
.
push
(
static_cast
<
int
>
(
!
val
)
);
}
break
;
}
...
...
@@ -1527,8 +1526,9 @@ static bool is_declarable(T const& cd, const std::vector<int>& opcode) {
}
if
(
stack
.
size
()
!=
1
||
stack
.
top
()
==
0
)
return
false
;
return
cd
.
code
==
CARD_MARINE_DOLPHIN
||
cd
.
code
==
CARD_TWINKLE_MOSS
||
(
!
cd
.
alias
&&
(
cd
.
type
&
(
TYPE_MONSTER
+
TYPE_TOKEN
))
!=
(
TYPE_MONSTER
+
TYPE_TOKEN
));
if
(
cd
.
type
&
TYPE_TOKEN
)
return
false
;
return
!
cd
.
alias
||
second_code
.
find
(
cd
.
code
)
!=
second_code
.
end
();
}
void
ClientField
::
UpdateDeclarableList
()
{
const
wchar_t
*
pname
=
mainGame
->
ebANCard
->
getText
();
...
...
gframe/client_field.h
View file @
7e1c4b75
...
...
@@ -69,7 +69,7 @@ public:
std
::
vector
<
ClientCard
*>
selected_cards
;
std
::
set
<
ClientCard
*>
selectsum_cards
;
std
::
vector
<
ClientCard
*>
selectsum_all
;
std
::
vector
<
int
>
declare_opcodes
;
std
::
vector
<
unsigned
int
>
declare_opcodes
;
std
::
vector
<
ClientCard
*>
display_cards
;
std
::
vector
<
int
>
sort_list
;
std
::
map
<
int
,
int
>
player_desc_hints
[
2
];
...
...
@@ -158,8 +158,6 @@ public:
}
//special cards
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_TWINKLE_MOSS 13857930
#define CARD_QUESTION 38723936
#endif //CLIENT_FIELD_H
gframe/duelclient.cpp
View file @
7e1c4b75
...
...
@@ -3644,7 +3644,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
int
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
mainGame
->
dField
.
declare_opcodes
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
mainGame
->
dField
.
declare_opcodes
.
push_back
(
BufferIO
::
ReadInt32
(
pbuf
));
mainGame
->
dField
.
declare_opcodes
.
push_back
(
buffer_read
<
uint32_t
>
(
pbuf
));
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetDesc
(
select_hint
));
else
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
564
));
...
...
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