#!/bin/sh
#
# disable_tpp  -- Disable the Third Person Perspective CTF mod...
#

cd ..
INST=`pwd`
BASE=`basename $INST`
if [ "$BASE" == "ctf" ]
then
  if [ -f gamei586.so ]
  then
    if [ -h gamei586.so ]
    then
      if [ -f thirdpp/tag ]
      then
        if [ -f zoid/gamei586.so ]
        then 
          rm -f thirdpp/tag
          rm -f gamei586.so
          ln -s zoid/gamei586.so gamei586.so
          echo `date` > zoid/tag
          echo "Thirdpp-CTF disabled..."
        else
          echo "ERROR: unable to find Quake2/ctf/zoid/gamei586.so"
        fi
      else
        if [ -f zoid/tag ]
        then
          echo "Thirdpp-CTF already disabled..."
        else
          echo "WARNING: Thirdpp-CTF not enabled..."
        fi
      fi
    else
      echo "WARNING: Thirdpp-CTF not enabled..."
    fi
  else
    echo "ERROR: unable to find Quake2/ctf/gamei586.so"
  fi
else
  echo "ERROR: not in Quake2/ctf/ directory..."
fi
