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
132db217
Commit
132db217
authored
Dec 28, 2019
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use lua_tointeger if it's actually an interger
parent
256d78bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
interpreter.cpp
interpreter.cpp
+7
-3
libeffect.cpp
libeffect.cpp
+2
-0
No files found.
interpreter.cpp
View file @
132db217
...
@@ -1031,7 +1031,7 @@ int32 interpreter::get_operation_value(card* pcard, int32 findex, int32 extraarg
...
@@ -1031,7 +1031,7 @@ int32 interpreter::get_operation_value(card* pcard, int32 findex, int32 extraarg
}
}
return
OPERATION_FAIL
;
return
OPERATION_FAIL
;
}
}
int32
result
=
std
::
round
(
lua_tonumber
(
current_state
,
-
1
));
int32
result
=
lua_isinteger
(
current_state
,
-
1
)
?
lua_tointeger
(
current_state
,
-
1
)
:
std
::
round
(
lua_tonumber
(
current_state
,
-
1
));
lua_pop
(
current_state
,
1
);
lua_pop
(
current_state
,
1
);
no_action
--
;
no_action
--
;
call_depth
--
;
call_depth
--
;
...
@@ -1050,8 +1050,10 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count) {
...
@@ -1050,8 +1050,10 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count) {
call_depth
++
;
call_depth
++
;
if
(
call_function
(
f
,
param_count
,
1
))
{
if
(
call_function
(
f
,
param_count
,
1
))
{
int32
result
=
0
;
int32
result
=
0
;
if
(
lua_isboolean
(
current_state
,
-
1
))
if
(
lua_isboolean
(
current_state
,
-
1
))
result
=
lua_toboolean
(
current_state
,
-
1
);
result
=
lua_toboolean
(
current_state
,
-
1
);
else
if
(
lua_isinteger
(
current_state
,
-
1
))
result
=
lua_tointeger
(
current_state
,
-
1
);
else
else
result
=
std
::
round
(
lua_tonumber
(
current_state
,
-
1
));
result
=
std
::
round
(
lua_tonumber
(
current_state
,
-
1
));
lua_pop
(
current_state
,
1
);
lua_pop
(
current_state
,
1
);
...
@@ -1084,8 +1086,10 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count, std::vector<i
...
@@ -1084,8 +1086,10 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count, std::vector<i
int32
stack_newtop
=
lua_gettop
(
current_state
);
int32
stack_newtop
=
lua_gettop
(
current_state
);
for
(
int32
index
=
stack_top
+
1
;
index
<=
stack_newtop
;
++
index
)
{
for
(
int32
index
=
stack_top
+
1
;
index
<=
stack_newtop
;
++
index
)
{
int32
return_value
=
0
;
int32
return_value
=
0
;
if
(
lua_isboolean
(
current_state
,
index
))
if
(
lua_isboolean
(
current_state
,
index
))
return_value
=
lua_toboolean
(
current_state
,
index
);
return_value
=
lua_toboolean
(
current_state
,
index
);
else
if
(
lua_isinteger
(
current_state
,
index
))
return_value
=
lua_tointeger
(
current_state
,
index
);
else
else
return_value
=
std
::
round
(
lua_tonumber
(
current_state
,
index
));
return_value
=
std
::
round
(
lua_tonumber
(
current_state
,
index
));
result
->
push_back
(
return_value
);
result
->
push_back
(
return_value
);
...
...
libeffect.cpp
View file @
132db217
...
@@ -266,6 +266,8 @@ int32 scriptlib::effect_set_value(lua_State *L) {
...
@@ -266,6 +266,8 @@ int32 scriptlib::effect_set_value(lua_State *L) {
peffect
->
flag
[
0
]
&=
~
EFFECT_FLAG_FUNC_VALUE
;
peffect
->
flag
[
0
]
&=
~
EFFECT_FLAG_FUNC_VALUE
;
if
(
lua_isboolean
(
L
,
2
))
if
(
lua_isboolean
(
L
,
2
))
peffect
->
value
=
lua_toboolean
(
L
,
2
);
peffect
->
value
=
lua_toboolean
(
L
,
2
);
else
if
(
lua_isinteger
(
L
,
2
))
peffect
->
value
=
lua_tointeger
(
L
,
2
);
else
else
peffect
->
value
=
std
::
round
(
lua_tonumber
(
L
,
2
));
peffect
->
value
=
std
::
round
(
lua_tonumber
(
L
,
2
));
}
}
...
...
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