#!/bin/bash

# Patch for York's road scoring bug. Place this in your game
# directory and run it with the command:
#   bash york_data_file_patch.sh
#
# You need to have zip, unzip, and patch installed. These seem to be standard
# on all modern Linux variants.

if test -e base.dat
then
    echo 'Patching base.dat now...'
    echo ''
    rm -f game.ini
    unzip base.dat game.ini
    echo ''
else
    echo 'Please run this program within the same directory as base.dat'
    exit 1
fi

cat << EOF | patch game.ini || exit 1
*** game.ini.old	Thu Mar 23 12:21:17 2006
--- game.ini.patched	Thu Mar 23 12:21:01 2006
***************
*** 46,50 ****
  letter = H
  home = Highway
! scoremultiplier = 10
  image = highwayman.png
  placesound = highwayman.wav
--- 46,50 ----
  letter = H
  home = Highway
! scoremultiplier = 1
  image = highwayman.png
  placesound = highwayman.wav
EOF

zip base.dat game.ini
rm -f game.ini

echo ''
echo 'Patching complete!'
echo ''

