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
nanahira
ygopro-core
Commits
7874592b
Commit
7874592b
authored
Dec 15, 2024
by
Chen Bill
Committed by
GitHub
Dec 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move check_playerid to common.h (#698)
* move check_playerid to common.h * update card::get_infos
parent
5c582863
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
card.cpp
card.cpp
+1
-1
common.h
common.h
+4
-0
field.cpp
field.cpp
+0
-4
field.h
field.h
+0
-2
ocgapi.cpp
ocgapi.cpp
+5
-0
No files found.
card.cpp
View file @
7874592b
...
...
@@ -167,7 +167,7 @@ int32_t card::get_infos(byte* buf, uint32_t query_flag, int32_t use_cache) {
base_atk_def
=
get_base_atk_def
();
}
//first 8 bytes: data length, query flag
p
+=
8
;
p
+=
2
*
sizeof
(
uint32_t
)
;
if
(
query_flag
&
QUERY_CODE
)
{
buffer_write
<
uint32_t
>
(
p
,
data
.
code
);
}
...
...
common.h
View file @
7874592b
...
...
@@ -12,6 +12,10 @@
#include <assert.h>
typedef
unsigned
char
byte
;
inline
bool
check_playerid
(
int32_t
playerid
)
{
return
playerid
>=
0
&&
playerid
<=
1
;
}
#define MATCH_ALL(x,y) (((x)&(y))==(y))
#define MATCH_ANY(x,y) ((x)&(y))
#define ADD_BIT(x,y) ((x)|=(y))
...
...
field.cpp
View file @
7874592b
...
...
@@ -13,10 +13,6 @@
#include "interpreter.h"
#include <cstring>
bool
check_playerid
(
int32_t
playerid
)
{
return
playerid
>=
0
&&
playerid
<=
1
;
}
int32_t
field
::
field_used_count
[
32
]
=
{
0
,
1
,
1
,
2
,
1
,
2
,
2
,
3
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
};
bool
chain
::
chain_operation_sort
(
const
chain
&
c1
,
const
chain
&
c2
)
{
...
...
field.h
View file @
7874592b
...
...
@@ -33,8 +33,6 @@ class effect;
using
effect_vector
=
std
::
vector
<
effect
*>
;
bool
check_playerid
(
int32_t
playerid
);
struct
tevent
{
card
*
trigger_card
{
nullptr
};
group
*
event_cards
{
nullptr
};
...
...
ocgapi.cpp
View file @
7874592b
...
...
@@ -190,6 +190,11 @@ extern "C" DECL_DLLEXPORT void new_tag_card(intptr_t pduel, uint32_t code, uint8
break
;
}
}
/**
* @brief Get card information.
* @param buf uint32_t array
* @return buffer length in bytes
*/
extern
"C"
DECL_DLLEXPORT
int32_t
query_card
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
sequence
,
int32_t
query_flag
,
byte
*
buf
,
int32_t
use_cache
)
{
if
(
!
check_playerid
(
playerid
))
return
LEN_FAIL
;
...
...
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