set LIBRARY= 
set INCLUDE= 

mkdir vmta
cd vmta
set cc=lcc -DQ3_VM -DMISSIONPACK -DCGAME -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1

rem %cc% ../bb_cg_bothud.c
rem @if errorlevel 1 goto quit
%cc% ../bb_cg_hud.c
@if errorlevel 1 goto quit
%cc%  ../bb_cgame.c
@if errorlevel 1 goto quit
%cc%  ../bg_client.c
@if errorlevel 1 goto quit
%cc% ../../game/bg_lib.c
@if errorlevel 1 goto quit
%cc% ../../game/bg_misc.c
@if errorlevel 1 goto quit
	
	@echo "bg_pmove.c replaced with cg_pmove.c, be sure to keep in synch with bg_pmove.c!!"
	rem %cc% ../../game/bg_pmove.c
	rem @if errorlevel 1 goto quit

	rem %cc% ../cg_atmospheric.c
	rem @if errorlevel 1 goto quit

%cc% ../cg_consolecmds.c
@if errorlevel 1 goto quit
%cc% ../cg_draw.c
@if errorlevel 1 goto quit
%cc% ../cg_drawtools.c
@if errorlevel 1 goto quit
%cc% ../cg_effects.c
@if errorlevel 1 goto quit
%cc% ../cg_ents.c
@if errorlevel 1 goto quit
%cc% ../cg_event.c
@if errorlevel 1 goto quit
%cc% ../cg_info.c
@if errorlevel 1 goto quit
%cc% ../cg_localents.c
@if errorlevel 1 goto quit
%cc% ../cg_main.c
@if errorlevel 1 goto quit
%cc% ../cg_marks.c
@if errorlevel 1 goto quit
%cc% ../cg_newDraw.c
@if errorlevel 1 goto quit
%cc% ../cg_players.c
@if errorlevel 1 goto quit
%cc% ../cg_playerstate.c
@if errorlevel 1 goto quit
%cc% ../cg_pmove.c
@if errorlevel 1 goto quit

	@echo "cg_predict.c removed""
	rem %cc% ../cg_predict.c
	rem @if errorlevel 1 goto quit

%cc% ../all_scoreboard.c
@if errorlevel 1 goto quit
%cc% ../cg_servercmds.c
@if errorlevel 1 goto quit
%cc% ../cg_snapshot.c
@if errorlevel 1 goto quit

	@echo "Not supposed to build cg_syscalls.c with vm compiles!!"
	rem %cc% ../cg_syscalls.c
	rem @if errorlevel 1 goto quit

%cc% ../cg_unlagged.c
@if errorlevel 1 goto quit	
%cc% ../cg_view.c
@if errorlevel 1 goto quit
%cc% ../cg_weapons.c
@if errorlevel 1 goto quit
%cc% ../../game/q_math.c
@if errorlevel 1 goto quit
%cc% ../../game/q_shared.c
@if errorlevel 1 goto quit
%cc% ../../ui/ui_shared.c
@if errorlevel 1 goto quit

q3asm -f ../cgame_ta

mkdir D:\quake3\newexpert\testta\
mkdir D:\quake3\newexpert\testta\vm

del D:\quake3\newexpert\vm00ta.pk3
move /Y D:\quake3\newexpert\Code\expertctf\code\cgame\vmta\cgame.qvm D:\quake3\newexpert\testta\vm\cgame.qvm

cd D:\quake3\newexpert\testta\
PKZIPC -add -dir=current D:\quake3\newexpert\vm00ta.zip *.*
ren D:\quake3\newexpert\vm00ta.zip vm00ta.pk3


:quit
pause
cd ..