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
91002a0a
Commit
91002a0a
authored
Aug 08, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add player_info::szone_size
actual size of LOCATION_SZONE in current rule
parent
6f76bf07
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
common.h
common.h
+1
-0
field.cpp
field.cpp
+7
-7
field.h
field.h
+1
-0
libdebug.cpp
libdebug.cpp
+4
-0
No files found.
common.h
View file @
91002a0a
...
...
@@ -43,6 +43,7 @@ typedef signed char int8;
#define NULL 0
#endif
#define MASTER_RULE3 3 //Master Rule 3 (2014)
#define NEW_MASTER_RULE 4 //New Master Rule (2017)
#define MASTER_RULE_2020 5 //Master Rule 2020
#define CURRENT_RULE 5
...
...
field.cpp
View file @
91002a0a
...
...
@@ -280,10 +280,10 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
if (playerid == preplayer && sequence == presequence)
return;
if(location == LOCATION_MZONE) {
if
(
sequence
>=
player
[
playerid
].
list_mzone
.
size
()
||
player
[
playerid
].
list_mzone
[
sequence
])
if(sequence >=
(int32)
player[playerid].list_mzone.size() || player[playerid].list_mzone[sequence])
return;
} else {
if
(
sequence
>=
player
[
playerid
].
list_szone
.
size
()
||
player
[
playerid
].
list_szone
[
sequence
])
if(sequence >= player[playerid].
szone_size
|| player[playerid].list_szone[sequence])
return;
}
if(preplayer == playerid) {
...
...
@@ -491,14 +491,14 @@ card* field::get_field_card(uint8 playerid, uint32 general_location, uint8 seque
return nullptr;
switch(general_location) {
case LOCATION_MZONE: {
if
(
sequence
<
player
[
playerid
].
list_mzone
.
size
())
if(sequence <
(int32)
player[playerid].list_mzone.size())
return player[playerid].list_mzone[sequence];
else
return nullptr;
break;
}
case LOCATION_SZONE: {
if
(
sequence
<
player
[
playerid
].
list_szone
.
size
()
)
if(sequence < player[playerid].
szone_size
)
return player[playerid].list_szone[sequence];
else
return nullptr;
...
...
@@ -565,7 +565,7 @@ int32 field::is_location_useable(uint8 playerid, uint32 general_location, uint8
return FALSE;
uint32 flag = player[playerid].disabled_location | player[playerid].used_location;
if (general_location == LOCATION_MZONE) {
if
(
sequence
>=
(
int32
)
player
[
0
].
list_mzone
.
size
())
if (sequence >= (int32)player[
playerid
].list_mzone.size())
return FALSE;
if(flag & (0x1u << sequence))
return FALSE;
...
...
@@ -575,7 +575,7 @@ int32 field::is_location_useable(uint8 playerid, uint32 general_location, uint8
return FALSE;
}
} else if (general_location == LOCATION_SZONE) {
if
(
sequence
>=
(
int32
)
player
[
0
].
list_szone
.
size
()
)
if (sequence >=
player[playerid].szone_size
)
return FALSE;
if(flag & (0x100u << sequence))
return FALSE;
...
...
@@ -1107,7 +1107,7 @@ void field::refresh_player_info(uint8 playerid) {
if (player[playerid].list_mzone[i])
used_flag |= 0x1U << i;
}
for
(
int32
i
=
0
;
i
<
(
int32
)
player
[
playerid
].
list_szone
.
size
()
;
++
i
)
{
for (int32 i = 0; i <
player[playerid].szone_size
; ++i) {
if (player[playerid].list_szone[i])
used_flag |= 0x100U << i;
}
...
...
field.h
View file @
91002a0a
...
...
@@ -87,6 +87,7 @@ struct player_info {
uint32
disabled_location
{
0
};
uint32
extra_p_count
{
0
};
uint32
tag_extra_p_count
{
0
};
int32
szone_size
{
6
};
card_vector
list_mzone
;
card_vector
list_szone
;
card_vector
list_main
;
...
...
libdebug.cpp
View file @
91002a0a
...
...
@@ -148,6 +148,10 @@ int32 scriptlib::debug_reload_field_begin(lua_State *L) {
pduel
->
game_field
->
core
.
duel_rule
=
1
;
else
pduel
->
game_field
->
core
.
duel_rule
=
CURRENT_RULE
;
if
(
pduel
->
game_field
->
core
.
duel_rule
==
MASTER_RULE3
)
{
pduel
->
game_field
->
player
[
0
].
szone_size
=
8
;
pduel
->
game_field
->
player
[
1
].
szone_size
=
8
;
}
return
0
;
}
int32
scriptlib
::
debug_reload_field_end
(
lua_State
*
L
)
{
...
...
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