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
e90ab044
Commit
e90ab044
authored
May 12, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a8685af9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
libduel.cpp
libduel.cpp
+16
-8
No files found.
libduel.cpp
View file @
e90ab044
...
@@ -1506,36 +1506,44 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
...
@@ -1506,36 +1506,44 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
uint32
uplayer
=
pduel
->
game_field
->
core
.
reason_player
;
uint32
uplayer
=
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>=
2
)
if
(
lua_gettop
(
L
)
>=
2
)
uplayer
=
lua_tointeger
(
L
,
2
);
uplayer
=
lua_tointeger
(
L
,
2
);
group
*
mg
=
0
;
bool
swapped
=
false
;
card
*
mcard
=
0
;
group
*
mgroup
=
0
;
uint32
used_location
=
0
;
uint32
used_location
=
0
;
player_info
::
card_vector
list_mzone
;
player_info
::
card_vector
list_mzone
;
if
(
lua_gettop
(
L
)
>=
3
&&
!
lua_isnil
(
L
,
3
))
{
if
(
lua_gettop
(
L
)
>=
3
&&
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
3
,
TRUE
))
{
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
mcard
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
}
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
,
TRUE
))
{
mgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
}
else
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
3
);
uint32
digit
=
1
;
uint32
digit
=
1
;
for
(
auto
cit
=
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
begin
();
cit
!=
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
end
();
++
cit
)
{
for
(
auto
cit
=
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
begin
();
cit
!=
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
&&
mg
->
container
.
find
(
pcard
)
==
mg
->
container
.
end
(
))
{
if
(
pcard
&&
pcard
!=
mcard
&&
!
(
mgroup
&&
mgroup
->
container
.
find
(
pcard
)
!=
mgroup
->
container
.
end
()
))
{
used_location
|=
digit
;
used_location
|=
digit
;
list_mzone
.
push_back
(
pcard
);
list_mzone
.
push_back
(
pcard
);
}
else
}
else
list_mzone
.
push_back
(
0
);
list_mzone
.
push_back
(
0
);
digit
<<=
1
;
digit
<<=
1
;
}
}
used_location
|=
pduel
->
game_field
->
player
[
playerid
].
used_location
&
0xff00
;
std
::
swap
(
used_location
,
pduel
->
game_field
->
player
[
playerid
].
used_location
);
std
::
swap
(
used_location
,
pduel
->
game_field
->
player
[
playerid
].
used_location
);
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
swap
(
list_mzone
);
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
swap
(
list_mzone
);
swapped
=
true
;
}
}
card
*
p
card
=
0
;
card
*
s
card
=
0
;
if
(
lua_gettop
(
L
)
>=
4
)
{
if
(
lua_gettop
(
L
)
>=
4
)
{
check_param
(
L
,
PARAM_TYPE_CARD
,
4
);
check_param
(
L
,
PARAM_TYPE_CARD
,
4
);
p
card
=
*
(
card
**
)
lua_touserdata
(
L
,
4
);
s
card
=
*
(
card
**
)
lua_touserdata
(
L
,
4
);
}
}
uint32
zone
=
0xff
;
uint32
zone
=
0xff
;
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
)
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
)
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count_fromex
(
p
card
,
playerid
,
uplayer
,
zone
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count_fromex
(
s
card
,
playerid
,
uplayer
,
zone
));
else
else
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
LOCATION_MZONE
,
uplayer
,
LOCATION_REASON_TOFIELD
,
zone
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
LOCATION_MZONE
,
uplayer
,
LOCATION_REASON_TOFIELD
,
zone
));
if
(
mg
)
{
if
(
swapped
)
{
pduel
->
game_field
->
player
[
playerid
].
used_location
=
used_location
;
pduel
->
game_field
->
player
[
playerid
].
used_location
=
used_location
;
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
swap
(
list_mzone
);
pduel
->
game_field
->
player
[
playerid
].
list_mzone
.
swap
(
list_mzone
);
}
}
...
...
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