Fix savegame not loading and improve build
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
5dcbafdeaa
commit
b5ed770d81
3 changed files with 11 additions and 7 deletions
11
start.sh
11
start.sh
|
|
@ -1,9 +1,12 @@
|
|||
#!/bin/sh
|
||||
SAVE_FILE="/root/.openttd/save/autosave/latest.sav"
|
||||
SAVE_DIR="/root/.openttd/save"
|
||||
LATEST_SAVE=$(ls -rt ${SAVE_DIR}/autosave/ | tail -n1)
|
||||
ABSOLUTE_SAVE="$SAVE_DIR/autosave/$LATEST_SAVE"
|
||||
|
||||
if [ -f "$SAVE_FILE" ]; then
|
||||
echo "Loading savegame: $SAVE_FILE"
|
||||
exec /openttd/openttd -D -g autosave/latest.sav
|
||||
|
||||
if [ -f "$ABSOLUTE_SAVE" ]; then
|
||||
echo "Loading savegame: $LATEST_SAVE"
|
||||
exec /openttd/openttd -D -g $ABSOLUTE_SAVE
|
||||
else
|
||||
echo "No savegame found. Starting new game."
|
||||
exec /openttd/openttd -D
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue