Skip to content

Commit

Permalink
fix(rust): random seed not generating
Browse files Browse the repository at this point in the history
a
  • Loading branch information
dgibbs64 committed Mar 26, 2023
1 parent e86848c commit 47365c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lgsm/functions/fix_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion lgsm/functions/info_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
}

Expand Down

0 comments on commit 47365c8

Please sign in to comment.