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
925d2528
Commit
925d2528
authored
Apr 12, 2020
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verify parameters of Duel.AnnounceCard
parent
fefb0c47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
libduel.cpp
libduel.cpp
+28
-0
No files found.
libduel.cpp
View file @
925d2528
...
...
@@ -3634,6 +3634,34 @@ int32 scriptlib::duel_announce_card(lua_State * L) {
for(int32 i = 2; i <= lua_gettop(L); ++i)
pduel->game_field->core.select_options.push_back((uint32)lua_tointeger(L, i));
}
int32 stack_size = 0;
for(auto& it : pduel->game_field->core.select_options) {
switch(it) {
case OPCODE_ADD:
case OPCODE_SUB:
case OPCODE_MUL:
case OPCODE_DIV:
case OPCODE_AND:
case OPCODE_OR:
stack_size -= 1;
break;
case OPCODE_NEG:
case OPCODE_NOT:
case OPCODE_ISCODE:
case OPCODE_ISSETCARD:
case OPCODE_ISTYPE:
case OPCODE_ISRACE:
case OPCODE_ISATTRIBUTE:
break;
default:
stack_size += 1;
break;
}
if(stack_size <= 0)
break;
}
if(stack_size != 1)
return luaL_error(L, "Parameters are invalid.");
pduel->game_field->add_process(PROCESSOR_ANNOUNCE_CARD, 0, 0, 0, playerid, 0);
return lua_yieldk(L, 0, (lua_KContext)pduel, [](lua_State *L, int32 status, lua_KContext ctx) {
duel* pduel = (duel*)ctx;
...
...
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