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
ac0471ae
Commit
ac0471ae
authored
May 23, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8ecee326
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
18 deletions
+24
-18
libduel.cpp
libduel.cpp
+24
-18
No files found.
libduel.cpp
View file @
ac0471ae
...
...
@@ -1492,11 +1492,13 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint32
uplayer
=
pduel
->
game_field
->
core
.
reason_player
;
uint32
reason
=
LOCATION_REASON_TOFIELD
;
if
(
lua_gettop
(
L
)
>
2
)
if
(
lua_gettop
(
L
)
>
=
3
)
uplayer
=
lua_tointeger
(
L
,
3
);
if
(
lua_gettop
(
L
)
>
3
)
if
(
lua_gettop
(
L
)
>
=
4
)
reason
=
lua_tointeger
(
L
,
4
);
uint32
zone
=
0xff
;
if
(
lua_gettop
(
L
)
>=
5
)
zone
=
lua_tointeger
(
L
,
5
);
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
,
zone
));
return
1
;
}
...
...
@@ -1512,8 +1514,8 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
bool
swapped
=
false
;
card
*
mcard
=
0
;
group
*
mgroup
=
0
;
uint32
used_location
=
0
;
player_info
::
card_vector
list_mzone
;
uint32
used_location
[
2
]
=
{
0
,
0
}
;
player_info
::
card_vector
list_mzone
[
2
]
;
if
(
lua_gettop
(
L
)
>=
3
&&
!
lua_isnil
(
L
,
3
))
{
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
3
,
TRUE
))
{
mcard
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
...
...
@@ -1521,19 +1523,21 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
mgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
}
else
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
3
);
uint32
digit
=
1
;
for
(
auto
cit
=
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
begin
();
cit
!=
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
&&
pcard
!=
mcard
&&
!
(
mgroup
&&
mgroup
->
container
.
find
(
pcard
)
!=
mgroup
->
container
.
end
()))
{
used_location
|=
digit
;
list_mzone
.
push_back
(
pcard
);
}
else
list_mzone
.
push_back
(
0
);
digit
<<=
1
;
for
(
int32
p
=
0
;
p
<
2
;
p
++
)
{
uint32
digit
=
1
;
for
(
auto
cit
=
pduel
->
game_field
->
player
[
p
].
list_mzone
.
begin
();
cit
!=
pduel
->
game_field
->
player
[
p
].
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
&&
pcard
!=
mcard
&&
!
(
mgroup
&&
mgroup
->
container
.
find
(
pcard
)
!=
mgroup
->
container
.
end
()))
{
used_location
[
p
]
|=
digit
;
list_mzone
[
p
].
push_back
(
pcard
);
}
else
list_mzone
[
p
].
push_back
(
0
);
digit
<<=
1
;
}
used_location
[
p
]
|=
pduel
->
game_field
->
player
[
p
].
used_location
&
0xff00
;
std
::
swap
(
used_location
[
p
],
pduel
->
game_field
->
player
[
p
].
used_location
);
pduel
->
game_field
->
player
[
p
].
list_mzone
.
swap
(
list_mzone
[
p
]);
}
used_location
|=
pduel
->
game_field
->
player
[
playerid
].
used_location
&
0xff00
;
std
::
swap
(
used_location
,
pduel
->
game_field
->
player
[
playerid
].
used_location
);
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
swap
(
list_mzone
);
swapped
=
true
;
}
card
*
scard
=
0
;
...
...
@@ -1547,8 +1551,10 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
else
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
LOCATION_MZONE
,
uplayer
,
LOCATION_REASON_TOFIELD
,
zone
));
if
(
swapped
)
{
pduel
->
game_field
->
player
[
playerid
].
used_location
=
used_location
;
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
swap
(
list_mzone
);
pduel
->
game_field
->
player
[
0
].
used_location
=
used_location
[
0
];
pduel
->
game_field
->
player
[
1
].
used_location
=
used_location
[
1
];
pduel
->
game_field
->
player
[
0
].
list_mzone
.
swap
(
list_mzone
[
0
]);
pduel
->
game_field
->
player
[
1
].
list_mzone
.
swap
(
list_mzone
[
1
]);
}
return
1
;
}
...
...
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