diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index 4488377a38..f1d5926581 100755 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -12,7 +12,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedic # Part of random seed feature. # If seed is not defined by user generate a seed file. -if [ -z "${seed}" ]; then +if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" fi diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index f5dc108da4..0bd219485e 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1490,7 +1490,11 @@ fn_info_game_rust() { serverlevel=${serverlevel:-"NOT SET"} customlevelurl=${customlevelurl:-"NOT SET"} worldsize=${worldsize:-"0"} - seed=${seed:-"0"} + if [ -n "${seed}" ]; then + seed=${seed:-"0"} + elif [ -f "${datadir}/${selfname}-seed.txt" ]; then + seed=$(cat "${datadir}/${selfname}-seed.txt") + fi salt=${salt:-"0"} }