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
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
MyCard
ygopro-core
Commits
47ad4fa9
Commit
47ad4fa9
authored
Nov 19, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Duel.GetTurnCount()
parent
96bbbedb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
field.cpp
field.cpp
+2
-0
field.h
field.h
+1
-0
libduel.cpp
libduel.cpp
+7
-1
processor.cpp
processor.cpp
+1
-0
No files found.
field.cpp
View file @
47ad4fa9
...
...
@@ -29,6 +29,8 @@ field::field(duel* pduel) {
infos
.
copy_id
=
1
;
infos
.
can_shuffle
=
TRUE
;
infos
.
turn_id
=
0
;
infos
.
turn_id_by_player
[
0
]
=
0
;
infos
.
turn_id_by_player
[
1
]
=
0
;
infos
.
card_id
=
1
;
infos
.
phase
=
0
;
infos
.
turn_player
=
0
;
...
...
field.h
View file @
47ad4fa9
...
...
@@ -112,6 +112,7 @@ struct field_info {
int32
field_id
;
int16
copy_id
;
int16
turn_id
;
int16
turn_id_by_player
[
2
];
int16
card_id
;
uint16
phase
;
uint8
turn_player
;
...
...
libduel.cpp
View file @
47ad4fa9
...
...
@@ -51,7 +51,13 @@ int32 scriptlib::duel_get_turn_player(lua_State *L) {
}
int32
scriptlib
::
duel_get_turn_count
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushinteger
(
L
,
pduel
->
game_field
->
infos
.
turn_id
);
if
(
lua_gettop
(
L
)
>
0
)
{
int32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
infos
.
turn_id_by_player
[
playerid
]);
}
else
lua_pushinteger
(
L
,
pduel
->
game_field
->
infos
.
turn_id
);
return
1
;
}
int32
scriptlib
::
duel_get_draw_count
(
lua_State
*
L
)
{
...
...
processor.cpp
View file @
47ad4fa9
...
...
@@ -3962,6 +3962,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
}
}
infos
.
turn_id
++
;
infos
.
turn_id_by_player
[
turn_player
]
++
;
infos
.
turn_player
=
turn_player
;
pduel
->
write_buffer8
(
MSG_NEW_TURN
);
pduel
->
write_buffer8
(
turn_player
);
...
...
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