1414#
1515# This program is distributed in the hope that it will be useful,
1616# but WITHOUT ANY WARRANTY; without even the implied warranty of
17- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1818# GNU Affero General Public License for more details.
1919#
2020# You should have received a copy of the GNU Affero General Public License
21- # along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
2222# ===========================================================================
2323#
2424
@@ -146,54 +146,54 @@ transfer-save() {
146146 local game_hash=$2
147147 local target=" $CRAWL_GIT_DIR /$BINARY_BASE_NAME -$game_hash /$SAVES "
148148 local src_save_dir=$( dirname $save )
149-
149+
150150 wecho -n ' {"msg":"show_dialog", "html":"'
151-
151+
152152 if [[ -d " $target " ]]; then
153153 # It's okay if moving the .prf fails (it might not exist one day).
154154 mv " $src_save_dir /start-$CHAR_NAME -ns.prf" " $target " 2> /dev/null || true
155155 mv -n " $src_save_dir /$CHAR_NAME " .cs " $target "
156156
157- if test $? -eq 0
158- then
157+ if test $? -eq 0
158+ then
159159 wcat << EOF
160160<p>Transferring successful!</p>
161161<input type='button' class='button' data-key=' ' value='Continue' style='float:right;'>
162162"}
163163EOF
164- cecho " : successful!"
165- cecho
166- OUR_GAME_HASH=" ${game_hash} "
164+ cecho " : successful!"
165+ cecho
166+ OUR_GAME_HASH=" ${game_hash} "
167167 cecho -n " --- any key to continue ---"
168- read -n 1 -t 5 -s
169- cecho
170- else
168+ read -n 1 -t 5 -s
169+ cecho
170+ else
171171 wcat << EOF
172172<p>Transferring failed!</p>
173173<p>Transferring your save failed! Continuing with former version.</p>
174174<input type='button' class='button' data-key=' ' value='Continue' style='float:right;'>
175175"}
176176EOF
177- cecho " : failed!"
178- cecho
179- cecho " Transferring your save failed! Continuing with former version."
177+ cecho " : failed!"
178+ cecho
179+ cecho " Transferring your save failed! Continuing with former version."
180180 cecho -n " --- any key to continue ---"
181- read -n 1 -s
182- cecho
183- fi
181+ read -n 1 -s
182+ cecho
183+ fi
184184 else
185185 wcat << EOF
186186<p>Transferring failed!</p>
187187<p>Target version is corrupt! Continuing with former version.</p>
188188<input type='button' class='button' data-key=' ' value='Continue' style='float:right;'>
189189"}
190190EOF
191- cecho " : failed!"
192- cecho
193- cecho " Target version is corrupt! Continuing with former version."
191+ cecho " : failed!"
192+ cecho
193+ cecho " Target version is corrupt! Continuing with former version."
194194 cecho -n " --- any key to continue ---"
195- read -n 1 -s
196- cecho
195+ read -n 1 -s
196+ cecho
197197 fi
198198 wecho ' {"msg":"hide_dialog"}'
199199}
@@ -217,19 +217,19 @@ if [[ -n "$SAVE" ]]; then
217217 then
218218 current_ver=" $( hash-description $OUR_GAME_HASH ) "
219219 cecho " Hi, you have a $current_ver save game:"
220- cecho
220+ cecho
221221
222- OUR_SGV_MAJOR=" $( major-version-for-game $OUR_GAME_HASH ) "
223- NEW_GAME_HASH=" $( newest-version-with-major-version $OUR_SGV_MAJOR ) "
222+ OUR_SGV_MAJOR=" $( major-version-for-game $OUR_GAME_HASH ) "
223+ NEW_GAME_HASH=" $( newest-version-with-major-version $OUR_SGV_MAJOR ) "
224224 new_ver=" $( hash-description $NEW_GAME_HASH ) "
225225
226226 if [[ " $OUR_GAME_HASH " != " $NEW_GAME_HASH " &&
227227 " $TRANSFER_ENABLED " == " 1" ]]; then
228228 wecho ' {"msg":"layer", "layer":"crt"}'
229229 wecho -n ' {"msg":"show_dialog", "html":"'
230230
231- if [[ " ${NEW_GAME_HASH} " != " ${LATEST_GAME_HASH} " ]]; then
232- cecho " There's a newer version ($new_ver ) that can load your save."
231+ if [[ " ${NEW_GAME_HASH} " != " ${LATEST_GAME_HASH} " ]]; then
232+ cecho " There's a newer version ($new_ver ) that can load your save."
233233 cecho -n " [T]ransfer your save to this version?"
234234 wcat << EOF
235235<p>There's a newer version ($new_ver ) that can load your save.</p>
@@ -239,39 +239,39 @@ if [[ -n "$SAVE" ]]; then
239239"}
240240EOF
241241 read -n 1 -s REPLY
242- cecho
243- else
242+ cecho
243+ else
244244 cecho -n " [T]ransfer your save to the latest version ($new_ver )?"
245245 wcat << EOF
246246<p>[T]ransfer your save to the latest version ($new_ver )?</p>
247247<input type='button' class='button' data-key='N' value='No' style='float:right;'>
248248<input type='button' class='button' data-key='T' value='Yes' style='float:right;'>
249249"}
250250EOF
251- read -n 1 -s REPLY
252- cecho
253- fi
251+ read -n 1 -s REPLY
252+ cecho
253+ fi
254254 wecho ' {"msg":"hide_dialog"}'
255255
256- if test " $REPLY " = " t" -o " $REPLY " = " T" -o " $REPLY " = " y" -o " $REPLY " = " Y"
257- then
258- cecho -n " Transferring..."
256+ if test " $REPLY " = " t" -o " $REPLY " = " T" -o " $REPLY " = " y" -o " $REPLY " = " Y"
257+ then
258+ cecho -n " Transferring..."
259259 transfer-save " $SAVE " " $NEW_GAME_HASH "
260- fi
261- else
262- if test " ${TRANSFER_ENABLED} " ! = " 1"
263- then
264- cecho " Transfering of saves is currently disabled."
265- cecho " Finish your game or end your character to play in latest version."
266- else
267- cecho " Your save cannot be tranferred though because of incompatibility."
268- cecho " Finish your game or end your character to play in latest version."
269- fi
260+ fi
261+ else
262+ if test " ${TRANSFER_ENABLED} " ! = " 1"
263+ then
264+ cecho " Transfering of saves is currently disabled."
265+ cecho " Finish your game or end your character to play in latest version."
266+ else
267+ cecho " Your save cannot be tranferred though because of incompatibility."
268+ cecho " Finish your game or end your character to play in latest version."
269+ fi
270270
271271 cecho -n " --- any key to continue ---"
272- [[ -z " $WEBTILES " ]] && read -n 1 -t 5 -s
273- cecho
274- fi
272+ [[ -z " $WEBTILES " ]] && read -n 1 -t 5 -s
273+ cecho
274+ fi
275275 fi
276276else
277277 OUR_GAME_HASH=" ${LATEST_GAME_HASH} "
0 commit comments