Fix savegame not loading and improve build
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Fábio André Damas 2025-06-04 20:37:26 +00:00
parent 5dcbafdeaa
commit b5ed770d81
3 changed files with 11 additions and 7 deletions

View file

@ -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