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
wyykak
ygopro
Commits
dccbce5e
Commit
dccbce5e
authored
Dec 30, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5 spells check
parent
4700ce30
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+15
-0
gframe/deck_manager.h
gframe/deck_manager.h
+2
-1
No files found.
gframe/deck_manager.cpp
View file @
dccbce5e
...
...
@@ -150,8 +150,21 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) {
if
(
it
!=
list
->
end
()
&&
dc
>
it
->
second
)
return
(
DECKERROR_LFLIST
<<
28
)
+
cit
->
first
;
}
int
spellcount
=
CheckSpellCount
(
deck
);
if
(
spellcount
>
5
)
{
return
(
DECKERROR_MAINCOUNT
<<
28
)
+
spellcount
;
}
return
0
;
}
int
DeckManager
::
CheckSpellCount
(
Deck
&
deck
)
{
int
spellcount
=
0
;
CardData
cd
;
for
(
auto
cit
:
deck
.
main
)
{
if
(
cit
->
second
.
type
&
TYPE_SPELL
)
spellcount
++
;
}
return
spellcount
;
}
int
DeckManager
::
LoadDeck
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
)
{
deck
.
clear
();
int
code
;
...
...
@@ -228,6 +241,8 @@ bool DeckManager::LoadSide(Deck& deck, int* dbuf, int mainc, int sidec) {
if
(
cdit
->
second
!=
pcount
[
cdit
->
first
])
return
false
;
#endif
if
(
CheckSpellCount
(
ndeck
)
>
5
)
return
false
;
deck
=
ndeck
;
return
true
;
}
...
...
gframe/deck_manager.h
View file @
dccbce5e
...
...
@@ -40,7 +40,8 @@ public:
const
wchar_t
*
GetLFListName
(
int
lfhash
);
const
std
::
unordered_map
<
int
,
int
>*
GetLFListContent
(
int
lfhash
);
int
CheckDeck
(
Deck
&
deck
,
int
lfhash
,
int
rule
);
int
LoadDeck
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
int
CheckSpellCount
(
Deck
&
deck
);
int
LoadDeck
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
bool
LoadSide
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
#ifndef YGOPRO_SERVER_MODE
void
GetCategoryPath
(
wchar_t
*
ret
,
int
index
,
const
wchar_t
*
text
);
...
...
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