Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yechentide committed Oct 22, 2022
1 parent 6729f28 commit 590b93f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
11 changes: 5 additions & 6 deletions bin/editor/configure_world.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ 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
-- /forest/无尽
-- /forest/森林

local answer = select_one(presets, "info", "请选择一个模板")
return presets_dir_path + answer
return answer
end

----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down
13 changes: 6 additions & 7 deletions bin/environment/install_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -74,16 +73,16 @@ 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
declare -r manager='apt'
fi

if [[ $1 == 'CentOS' ]]; then
if [[ $(whoami) == 'root' ]] then
if [[ $(whoami) == 'root' ]]; then
yum update -y
else
sudo yum update -y
Expand All @@ -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"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/models/table_forest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ forest_settings_table = {
value = "always",
type = "nonealways"
},
["受到的伤害"] = {
["受到的破坏"] = {
key = "lessdamagetaken",
value = "none",
type = "damage01"
Expand Down

0 comments on commit 590b93f

Please sign in to comment.