Skip to content

Commit 7d54fad

Browse files
committed
fix: lua call error
1 parent 83ad244 commit 7d54fad

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

.gitignore

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
build
2-
.xmake
3-
.vscode/*.json
4-
.DS_Store
5-
.idea
6-
*.a
7-
*.o
8-
9-
3rd/*
10-
!3rd/fetch.lua
11-
!3rd/copy.lua
12-
!3rd/xmake.lua
13-
!3rd/pre
14-
!3rd/.include
15-
!.vscode/launch.json
16-
dist
17-
.xrepo
18-
project.xcworkspace
19-
xcuserdata
20-
cmake_install.cmake
21-
CMakeCache.txt
22-
CMakeLists.txt
23-
*.xcodeproj
24-
CMakeFiles
25-
CMakeScripts
1+
build
2+
.xmake
3+
.vscode/*.json
4+
.DS_Store
5+
.idea
6+
*.a
7+
*.o
8+
9+
3rd/*
10+
!3rd/fetch.lua
11+
!3rd/copy.lua
12+
!3rd/xmake.lua
13+
!3rd/pre
14+
!3rd/.include
15+
!.vscode/launch.json
16+
dist
17+
.xrepo
18+
project.xcworkspace
19+
xcuserdata
20+
cmake_install.cmake
21+
CMakeCache.txt
22+
CMakeLists.txt
23+
*.xcodeproj
24+
CMakeFiles
25+
CMakeScripts
26+
27+
games

src/LUAHandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,8 +1318,8 @@ int LUAHandler::callFunction(bool is_callback, const char *cmd, void *data) {
13181318
buf = new char[strlen(p) + 1]{0};
13191319
memcpy(buf, p, strlen(p) + 1);
13201320
lua_pushstring(state, buf);
1321-
} else {
1322-
// 自动读取变量
1321+
} else if (false) {
1322+
// Todo 自动读取变量,之前有旧版实现已经是在 lua 再调用其他 lua 的 c 实现来读取参数不能默认开启,等加一个开关在 ns 脚本里手动开启
13231323
sh->nextParam();
13241324
while (sh->current_variable.type != ScriptHandler::VAR_NONE) {
13251325
if (sh->current_variable.type == ScriptHandler::VAR_INT) {

xmake.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ if is_plat("windows") then
4545
add_defines("XMD_H=1")
4646
add_cxflags("/utf-8")
4747
add_cxflags("/UNICODE")
48+
add_cxflags("/EHsc")
4849

4950
if get_config("omp") then
5051
add_cxflags("/openmp")

0 commit comments

Comments
 (0)