Commit fa884004 authored by nanahira's avatar nanahira

Merge branch 'master' into develop

parents 72e05741 2d486e69
...@@ -82,7 +82,14 @@ mat_macos: ...@@ -82,7 +82,14 @@ mat_macos:
build_linux_x64: build_linux_x64:
extends: .build_unix extends: .build_unix
build_linux_x64_no_longjmp:
extends: .build_unix
except: [] except: []
only:
- '888'
variables:
NO_LONGJMP: '1'
build_linux_x32: build_linux_x32:
extends: .build_unix extends: .build_unix
...@@ -189,11 +196,11 @@ upload_to_minio: ...@@ -189,11 +196,11 @@ upload_to_minio:
tags: tags:
- linux - linux
dependencies: dependencies:
- build_linux_x64 - build_linux_x64_no_longjmp
variables: variables:
SERVER_USER: nanahira SERVER_USER: nanahira
SERVER_HOST: koishi.momobako.com SERVER_HOST: koishi.momobako.com
FROM_PATH: '' FROM_PATH: 'dist/x64/libocgcore.so'
SERVER_PATH: '' SERVER_PATH: ''
script: script:
- apt update && apt -y install openssh-client rsync coreutils - apt update && apt -y install openssh-client rsync coreutils
...@@ -207,7 +214,6 @@ upload_to_minio: ...@@ -207,7 +214,6 @@ upload_to_minio:
deploy_888: deploy_888:
extends: .deploy_to_server extends: .deploy_to_server
variables: variables:
FROM_PATH: 'dist/x64/libocgcore.so'
SERVER_PATH: '~/ygopro-super-pre/bin/release/' SERVER_PATH: '~/ygopro-super-pre/bin/release/'
only: only:
- '888' - '888'
...@@ -1458,14 +1458,14 @@ int32_t scriptlib::duel_confirm_cards(lua_State *L) { ...@@ -1458,14 +1458,14 @@ int32_t scriptlib::duel_confirm_cards(lua_State *L) {
int32_t scriptlib::duel_sort_decktop(lua_State *L) { int32_t scriptlib::duel_sort_decktop(lua_State *L) {
check_action_permission(L); check_action_permission(L);
check_param_count(L, 3); check_param_count(L, 3);
uint32_t sort_player = (uint32_t)lua_tointeger(L, 1); int32_t sort_player = (int32_t)lua_tointeger(L, 1);
uint32_t target_player = (uint32_t)lua_tointeger(L, 2); int32_t target_player = (int32_t)lua_tointeger(L, 2);
uint32_t count = (uint32_t)lua_tointeger(L, 3); int32_t count = (int32_t)lua_tointeger(L, 3);
if(sort_player != 0 && sort_player != 1) if (!check_playerid(sort_player))
return 0; return 0;
if(target_player != 0 && target_player != 1) if (!check_playerid(target_player))
return 0; return 0;
if(count < 1 || count > 16) if (count < 1)
return 0; return 0;
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
pduel->game_field->add_process(PROCESSOR_SORT_DECK, 0, 0, 0, sort_player + (target_player << 16), count); pduel->game_field->add_process(PROCESSOR_SORT_DECK, 0, 0, 0, sort_player + (target_player << 16), count);
......
newoption { trigger = "lua-dir", description = "", value = "PATH", default = "./lua" } newoption { trigger = "lua-dir", description = "", value = "PATH", default = "./lua" }
newoption { trigger = "sqlite3-dir", description = "", value = "PATH" } newoption { trigger = "sqlite3-dir", description = "", value = "PATH" }
newoption { trigger = "no-longjmp", description = "Disable use of longjmp for error handling in Lua" }
boolOptions = { boolOptions = {
"no-lua-safe", "no-lua-safe",
...@@ -19,6 +20,7 @@ if not os.isdir(LUA_DIR) then ...@@ -19,6 +20,7 @@ if not os.isdir(LUA_DIR) then
end end
SQLITE3_DIR=GetParam("sqlite3-dir") SQLITE3_DIR=GetParam("sqlite3-dir")
USE_LONGJMP=not GetParam("no-longjmp")
function ApplyBoolean(param) function ApplyBoolean(param)
if GetParam(param) then if GetParam(param) then
...@@ -33,7 +35,9 @@ workspace "ocgcoredll" ...@@ -33,7 +35,9 @@ workspace "ocgcoredll"
configurations { "Release", "Debug" } configurations { "Release", "Debug" }
platforms { "x64", "x32", "arm64", "wasm" } platforms { "x64", "x32", "arm64", "wasm" }
defines { "LUA_USE_LONGJMP" } if USE_LONGJMP then
defines { "LUA_USE_LONGJMP" }
end
for _, boolOption in ipairs(boolOptions) do for _, boolOption in ipairs(boolOptions) do
ApplyBoolean(boolOption) ApplyBoolean(boolOption)
...@@ -79,7 +83,9 @@ workspace "ocgcoredll" ...@@ -79,7 +83,9 @@ workspace "ocgcoredll"
filter "system:linux" filter "system:linux"
defines { "LUA_USE_LINUX" } defines { "LUA_USE_LINUX" }
pic "On" pic "On"
linkoptions { "-static-libstdc++", "-static-libgcc" } if USE_LONGJMP then
linkoptions { "-static-libstdc++", "-static-libgcc" }
end
filter "platforms:wasm" filter "platforms:wasm"
toolset "emcc" toolset "emcc"
......
...@@ -5,8 +5,6 @@ project "lua" ...@@ -5,8 +5,6 @@ project "lua"
files { "src/*.c", "src/*.h" } files { "src/*.c", "src/*.h" }
removefiles { "src/lua.c", "src/luac.c", "src/onelua.c" } removefiles { "src/lua.c", "src/luac.c", "src/onelua.c" }
defines { "LUA_USE_LONGJMP" }
if not GetParam("no-lua-safe") then if not GetParam("no-lua-safe") then
removefiles { "src/linit.c" } removefiles { "src/linit.c" }
end end
......
...@@ -28,5 +28,5 @@ project "ocgcore" ...@@ -28,5 +28,5 @@ project "ocgcore"
defines { "LUA_USE_LINUX" } defines { "LUA_USE_LINUX" }
if OCGCORE_DYNAMIC then if OCGCORE_DYNAMIC then
pic "On" pic "On"
linkoptions { "-static-libstdc++", "-static-libgcc" } -- linkoptions { "-static-libstdc++", "-static-libgcc" }
end end
...@@ -675,15 +675,15 @@ uint32_t field::process() { ...@@ -675,15 +675,15 @@ uint32_t field::process() {
++it->step; ++it->step;
} else { } else {
if(returns.bvalue[0] != 0xff) { if(returns.bvalue[0] != 0xff) {
card* tc[16]; card* tc[256];
for(i = 0; i < count; ++i) for(i = 0; i < count; ++i)
player[target_player].list_main.pop_back(); player[target_player].list_main.pop_back();
for(i = 0; i < count; ++i) for(i = 0; i < count; ++i)
tc[returns.bvalue[i]] = core.select_cards[i]; tc[returns.bvalue[i]] = core.select_cards[i];
for(i = 0; i < count; ++i) { for(i = 0; i < count; ++i) {
player[target_player].list_main.push_back(tc[count - i - 1]); player[target_player].list_main.push_back(tc[count - 1 - i]);
tc[count - i - 1]->current.sequence = (uint8_t)player[target_player].list_main.size() - 1;
} }
reset_sequence(target_player, LOCATION_DECK);
auto clit = player[target_player].list_main.rbegin(); auto clit = player[target_player].list_main.rbegin();
for(i = 0; i < count; ++i, ++clit) { for(i = 0; i < count; ++i, ++clit) {
card* pcard = *clit; card* pcard = *clit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment