diff --git a/bin/editor/configure_world.lua b/bin/editor/configure_world.lua index 3346e01..dd0b3ab 100755 --- a/bin/editor/configure_world.lua +++ b/bin/editor/configure_world.lua @@ -149,7 +149,7 @@ function select_preset(is_overground) keyword = "forest" end - local command = "find "..presets_dir_path.."/*"..keyword.."/*.lua -type f | awk -F. '{print $2}' | sort | uniq" + local command = "find "..presets_dir_path.."/*"..keyword.."/*.lua -type f | awk -F. '{print $1}' | sort | uniq" local result = exec_linux_command_get_output(command) local presets = split(result, "\n") -- /custom_forest/AAA @@ -157,7 +157,7 @@ function select_preset(is_overground) -- /forest/森林 local answer = select_one(presets, "info", "请选择一个模板") - return presets_dir_path + answer + return answer end ---------------------------------------------------------------------------------------------- @@ -230,8 +230,8 @@ function generate_new(shard_dir_path, is_overground) end local name = readline(false, "info", "请输入新模板的名字") - local gen_file = target_dir.."/"..name + gen_suffix - local set_file = target_dir.."/"..name + set_suffix + local gen_file = target_dir.."/"..name..gen_suffix + local set_file = target_dir.."/"..name..set_suffix color_print("tip", "新模板文件位于 "..target_dir, true) color_print("tip", "保存新模板时选择已有模板, 就可以更新模板。(默认模板无法修改)", true) @@ -244,12 +244,11 @@ function generate_new(shard_dir_path, is_overground) else copy_file(WORLD_PRESETS_DIR.."/cave/洞穴.wgp.lua", gen_file, false) apply_changes_to_file(model_gen, gen_file) - copy_file(WORLD_PRESETS_DIR.."/forest/洞穴.wsp.lua", set_file, false) + copy_file(WORLD_PRESETS_DIR.."/cave/洞穴.wsp.lua", set_file, false) apply_changes_to_file(model_set, set_file) end sleep(3) - break end clear() diff --git a/bin/environment/install_dependencies b/bin/environment/install_dependencies index 7668ca4..eb68714 100755 --- a/bin/environment/install_dependencies +++ b/bin/environment/install_dependencies @@ -58,8 +58,7 @@ if [[ $is_sudoer == 'no' ]] && [[ $(whoami) != 'root' ]]; then exit 1 fi -which sudo > /dev/null 2>&1 -if [[ $? == 1 ]] && [[ $(whoami) != 'root' ]]; then +if which sudo > /dev/null 2>&1; [[ $? == 1 ]] && [[ $(whoami) != 'root' ]]; then color_print error '没有sudo命令,无权限下载安装必须软件,终止运行脚本。请联系服务器管理员解决。' exit 1 fi @@ -74,8 +73,8 @@ color_print -n info '即将以管理员权限下载更新软件,可能会要 count_down 3 if [[ $1 == 'Ubuntu' ]]; then - if [[ $(whoami) == 'root' ]] then - apt update && sudo apt upgrade -y + if [[ $(whoami) == 'root' ]]; then + apt update && apt upgrade -y else sudo apt update && sudo apt upgrade -y fi @@ -83,7 +82,7 @@ if [[ $1 == 'Ubuntu' ]]; then fi if [[ $1 == 'CentOS' ]]; then - if [[ $(whoami) == 'root' ]] then + if [[ $(whoami) == 'root' ]]; then yum update -y else sudo yum update -y @@ -93,7 +92,7 @@ fi declare package for package in ${requires[@]}; do - if [[ $(whoami) == 'root' ]] then + if [[ $(whoami) == 'root' ]]; then eval "$manager install -y $package" else eval "sudo $manager install -y $package" @@ -102,7 +101,7 @@ done if [[ $1 == 'CentOS' ]] && [[ ! -e /usr/lib64/libcurl-gnutls.so.4 ]]; then # To fix: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory - if [[ $(whoami) == 'root' ]] then + if [[ $(whoami) == 'root' ]]; then ln -s /usr/lib64/libcurl.so.4 /usr/lib64/libcurl-gnutls.so.4 else sudo ln -s /usr/lib64/libcurl.so.4 /usr/lib64/libcurl-gnutls.so.4 diff --git a/lib/models/table_forest.lua b/lib/models/table_forest.lua index 84ea73d..696cf98 100644 --- a/lib/models/table_forest.lua +++ b/lib/models/table_forest.lua @@ -488,7 +488,7 @@ forest_settings_table = { value = "always", type = "nonealways" }, - ["受到的伤害"] = { + ["受到的破坏"] = { key = "lessdamagetaken", value = "none", type = "damage01"