Skip to content

Commit

Permalink
fix: lua call error
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromake committed Mar 5, 2024
1 parent 83ad244 commit 7d54fad
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
52 changes: 27 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
build
.xmake
.vscode/*.json
.DS_Store
.idea
*.a
*.o

3rd/*
!3rd/fetch.lua
!3rd/copy.lua
!3rd/xmake.lua
!3rd/pre
!3rd/.include
!.vscode/launch.json
dist
.xrepo
project.xcworkspace
xcuserdata
cmake_install.cmake
CMakeCache.txt
CMakeLists.txt
*.xcodeproj
CMakeFiles
CMakeScripts
build
.xmake
.vscode/*.json
.DS_Store
.idea
*.a
*.o

3rd/*
!3rd/fetch.lua
!3rd/copy.lua
!3rd/xmake.lua
!3rd/pre
!3rd/.include
!.vscode/launch.json
dist
.xrepo
project.xcworkspace
xcuserdata
cmake_install.cmake
CMakeCache.txt
CMakeLists.txt
*.xcodeproj
CMakeFiles
CMakeScripts

games
4 changes: 2 additions & 2 deletions src/LUAHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,8 @@ int LUAHandler::callFunction(bool is_callback, const char *cmd, void *data) {
buf = new char[strlen(p) + 1]{0};
memcpy(buf, p, strlen(p) + 1);
lua_pushstring(state, buf);
} else {
// 自动读取变量
} else if (false) {
// Todo 自动读取变量,之前有旧版实现已经是在 lua 再调用其他 lua 的 c 实现来读取参数不能默认开启,等加一个开关在 ns 脚本里手动开启
sh->nextParam();
while (sh->current_variable.type != ScriptHandler::VAR_NONE) {
if (sh->current_variable.type == ScriptHandler::VAR_INT) {
Expand Down
1 change: 1 addition & 0 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ if is_plat("windows") then
add_defines("XMD_H=1")
add_cxflags("/utf-8")
add_cxflags("/UNICODE")
add_cxflags("/EHsc")

if get_config("omp") then
add_cxflags("/openmp")
Expand Down

0 comments on commit 7d54fad

Please sign in to comment.