rem =====================================
rem MAP Launcher Batch File v1.0
rem Feel free to use in your own programs
rem =====================================

echo off
cls
echo Map Launcher Batch File v1.0 by Mike Shaw
rem  modified for Bedrone by Billy Boy
echo =============================================
echo.
echo Scanning for necessary files...

if not exist Bedrone.map echo Can't find Bedrone.map
if not exist Bedgame.con echo Can't find Bedgame.con
if not exist Beduser.con echo Can't find Beduser.con
if not exist Beddefs.con echo Can't find Beddefs.con 
if not exist Bedrone.mid echo Can't find Bedrone.mid


echo.
echo Backing up original files

if exist game.con      copy /y game.con gamBetmp.con
if exist user.con      copy /y user.con usrBetmp.con
if exist defs.con      copy /y defs.con defBetmp.con
if exist dethtoll.mid  copy /y dethtoll.mid midBetmp.mid

echo Done.
echo.
echo Initializing new files

copy /y Bedgame.con game.con
copy /y Beduser.con user.con
copy /y Beddefs.con defs.con
copy /y Bedrone.mid dethtoll.mid

echo Done.
echo.
duke3d -map Bedrone.map
cls
echo off

echo Deleting temporary versions of files

erase game.con
erase user.con
erase defs.con
erase dethtoll.mid

echo Restoring original files

if exist gamBetmp.con  ren gamBetmp.con game.con
if exist usrBetmp.con  ren usrBetmp.con user.con
if exist defBetmp.con  ren defBetmp.con defs.con
if exist midBetmp.mid  ren midBetmp.mid dethtoll.mid


echo Done.
