Index: code/server/sv_game.c
===================================================================
--- code/server/sv_game.c	(revision 15)
+++ code/server/sv_game.c	(working copy)
@@ -854,7 +854,7 @@
 
 
 	default:
-		Com_Error( ERR_DROP, "Bad game system trap: %i", args[0] );
+		Com_Error( ERR_DROP, "Bad game system trap: %ld", (long int) args[0] );
 	}
 	return -1;
 }
Index: code/server/sv_client.c
===================================================================
--- code/server/sv_client.c	(revision 15)
+++ code/server/sv_client.c	(working copy)
@@ -689,7 +689,7 @@
 */
 void SV_StopDownload_f( client_t *cl ) {
 	if (*cl->downloadName)
-		Com_DPrintf( "clientDownload: %d : file \"%s\" aborted\n", cl - svs.clients, cl->downloadName );
+		Com_DPrintf( "clientDownload: %d : file \"%s\" aborted\n", (int) (cl - svs.clients), cl->downloadName );
 
 	SV_CloseDownload( cl );
 }
@@ -720,11 +720,11 @@
 	int block = atoi( Cmd_Argv(1) );
 
 	if (block == cl->downloadClientBlock) {
-		Com_DPrintf( "clientDownload: %d : client acknowledge of block %d\n", cl - svs.clients, block );
+		Com_DPrintf( "clientDownload: %d : client acknowledge of block %d\n", (int) (cl - svs.clients), block );
 
 		// Find out if we are done.  A zero-length block indicates EOF
 		if (cl->downloadBlockSize[cl->downloadClientBlock % MAX_DOWNLOAD_WINDOW] == 0) {
-			Com_Printf( "clientDownload: %d : file \"%s\" completed\n", cl - svs.clients, cl->downloadName );
+			Com_Printf( "clientDownload: %d : file \"%s\" completed\n", (int) (cl - svs.clients), cl->downloadName );
 			SV_CloseDownload( cl );
 			return;
 		}
@@ -819,11 +819,11 @@
 			// cannot auto-download file
 			if(unreferenced)
 			{
-				Com_Printf("clientDownload: %d : \"%s\" is not referenced and cannot be downloaded.\n", cl - svs.clients, cl->downloadName);
+				Com_Printf("clientDownload: %d : \"%s\" is not referenced and cannot be downloaded.\n", (int) (cl - svs.clients), cl->downloadName);
 				Com_sprintf(errorMessage, sizeof(errorMessage), "File \"%s\" is not referenced and cannot be downloaded.", cl->downloadName);
 			}
 			else if (idPack) {
-				Com_Printf("clientDownload: %d : \"%s\" cannot download id pk3 files\n", cl - svs.clients, cl->downloadName);
+				Com_Printf("clientDownload: %d : \"%s\" cannot download id pk3 files\n", (int) (cl - svs.clients), cl->downloadName);
 				if (missionPack) {
 					Com_sprintf(errorMessage, sizeof(errorMessage), "Cannot autodownload Team Arena file \"%s\"\n"
 									"The Team Arena mission pack can be found in your local game store.", cl->downloadName);
@@ -835,7 +835,7 @@
 			else if ( !(sv_allowDownload->integer & DLF_ENABLE) ||
 				(sv_allowDownload->integer & DLF_NO_UDP) ) {
 
-				Com_Printf("clientDownload: %d : \"%s\" download disabled", cl - svs.clients, cl->downloadName);
+				Com_Printf("clientDownload: %d : \"%s\" download disabled", (int) (cl - svs.clients), cl->downloadName);
 				if (sv_pure->integer) {
 					Com_sprintf(errorMessage, sizeof(errorMessage), "Could not download \"%s\" because autodownloading is disabled on the server.\n\n"
 										"You will need to get this file elsewhere before you "
@@ -849,7 +849,7 @@
 			} else {
         // NOTE TTimo this is NOT supposed to happen unless bug in our filesystem scheme?
         //   if the pk3 is referenced, it must have been found somewhere in the filesystem
-				Com_Printf("clientDownload: %d : \"%s\" file not found on server\n", cl - svs.clients, cl->downloadName);
+				Com_Printf("clientDownload: %d : \"%s\" file not found on server\n", (int) (cl - svs.clients), cl->downloadName);
 				Com_sprintf(errorMessage, sizeof(errorMessage), "File \"%s\" not found on server for autodownloading.\n", cl->downloadName);
 			}
 			MSG_WriteByte( msg, svc_download );
@@ -861,7 +861,7 @@
 			return;
 		}
  
-		Com_Printf( "clientDownload: %d : beginning \"%s\"\n", cl - svs.clients, cl->downloadName );
+		Com_Printf( "clientDownload: %d : beginning \"%s\"\n", (int) (cl - svs.clients), cl->downloadName );
 		
 		// Init
 		cl->downloadCurrentBlock = cl->downloadClientBlock = cl->downloadXmitBlock = 0;
@@ -970,7 +970,7 @@
 			MSG_WriteData( msg, cl->downloadBlocks[curindex], cl->downloadBlockSize[curindex] );
 		}
 
-		Com_DPrintf( "clientDownload: %d : writing block %d\n", cl - svs.clients, cl->downloadXmitBlock );
+		Com_DPrintf( "clientDownload: %d : writing block %d\n", (int) (cl - svs.clients), cl->downloadXmitBlock );
 
 		// Move on to the next block
 		// It will get sent with next snap shot.  The rate will keep us in line.
@@ -1590,7 +1590,7 @@
 	} else if ( c == clc_moveNoDelta ) {
 		SV_UserMove( cl, msg, qfalse );
 	} else if ( c != clc_EOF ) {
-		Com_Printf( "WARNING: bad command byte for client %i\n", cl - svs.clients );
+		Com_Printf( "WARNING: bad command byte for client %i\n", (int) (cl - svs.clients) );
 	}
 //	if ( msg->readcount != msg->cursize ) {
 //		Com_Printf( "WARNING: Junk at end of packet for client %i\n", cl - svs.clients );
Index: code/qcommon/q_shared.h
===================================================================
--- code/qcommon/q_shared.h	(revision 15)
+++ code/qcommon/q_shared.h	(working copy)
@@ -26,8 +26,7 @@
 // q_shared.h -- included first by ALL program modules.
 // A user mod should never modify this file
 
-#define Q3_VERSION            "ioQ3 1.33"
-#define SVN_VERSION			  "WoP 1.0 (ioQ3 r1026)"
+#define Q3_VERSION	      "WoP 1.0"
 #ifndef SVN_VERSION
   #define SVN_VERSION Q3_VERSION
 #endif
Index: code/qcommon/vm_x86_64.c
===================================================================
--- code/qcommon/vm_x86_64.c	(revision 15)
+++ code/qcommon/vm_x86_64.c	(working copy)
@@ -422,7 +422,7 @@
 		unlink(fn_s);
 		unlink(fn_o);
 
-		Com_Printf(S_COLOR_RED "can't create temporary files for vm\n", fn_s);
+		Com_Printf(S_COLOR_RED "can't create temporary file %s for vm\n", fn_s);
 		vm->compiled = qfalse;
 		return;
 	}
@@ -895,7 +895,7 @@
 	fflush(qdasmout);
 #endif
 
-	Com_Printf( "VM file %s compiled to %i bytes of code (0x%lx - 0x%lx)\n", vm->name, vm->codeLength, vm->codeBase, vm->codeBase+vm->codeLength );
+	Com_Printf( "VM file %s compiled to %i bytes of code (%p - %p)\n", vm->name, vm->codeLength, vm->codeBase, vm->codeBase+vm->codeLength );
 
 out:
 	close(fd_o);
@@ -990,7 +990,7 @@
 	);
 
 	if ( opStack != &stack[1] ) {
-		Com_Error( ERR_DROP, "opStack corrupted in compiled code (offset %d)\n", (void*)&stack[1] - opStack);
+		Com_Error( ERR_DROP, "opStack corrupted in compiled code (offset %ld)\n", (long int) ((void *) &stack[1] - opStack));
 	}
 	if ( programStack != stackOnEntry - 48 ) {
 		Com_Error( ERR_DROP, "programStack corrupted in compiled code\n" );
Index: code/qcommon/vm_interpreted.c
===================================================================
--- code/qcommon/vm_interpreted.c	(revision 15)
+++ code/qcommon/vm_interpreted.c	(working copy)
@@ -907,7 +907,7 @@
 	vm->currentlyInterpreting = qfalse;
 
 	if ( opStack != &stack[1] ) {
-		Com_Error( ERR_DROP, "Interpreter error: opStack = %i", opStack - stack );
+		Com_Error( ERR_DROP, "Interpreter error: opStack = %ld", (long int) (opStack - stack) );
 	}
 
 	vm->programStack = stackOnEntry;
Index: code/botlib/be_ai_chat.c
===================================================================
--- code/botlib/be_ai_chat.c	(revision 15)
+++ code/botlib/be_ai_chat.c	(working copy)
@@ -2980,9 +2980,9 @@
 		file = LibVarString("rchatfile", "rchat.c");
 		replychats = BotLoadReplyChat(file);
 	} //end if
-*/
-	file = LibVarString("matchfile", "match.c");
-	matchtemplates = BotLoadMatchTemplates(file);
+*/
+	file = LibVarString("matchfile", "match.c");
+	matchtemplates = BotLoadMatchTemplates(file);
 
 	InitConsoleMessageHeap();
 
Index: code/botlib/be_ai_goal.c
===================================================================
--- code/botlib/be_ai_goal.c	(revision 15)
+++ code/botlib/be_ai_goal.c	(working copy)
@@ -183,7 +183,7 @@
 levelitem_t *levelitemheap = NULL; // bk001206 - init
 levelitem_t *freelevelitems = NULL; // bk001206 - init
 levelitem_t *levelitems = NULL; // bk001206 - init
-levelitem_t *spoton_li = NULL;	// cyr
+levelitem_t *spoton_li = NULL;	// cyr
 int numlevelitems = 0;
 //map locations
 maplocation_t *maplocations = NULL; // bk001206 - init
@@ -199,44 +199,44 @@
 // Parameter:				-
 // Returns:					-
 // Changes Globals:		-
-//========================================================================
-//cyr{
-
-void PrintCurItemInfo(){
-	if(spoton_li == NULL){
-		botimport.Print(PRT_MESSAGE, "no item\n");
-		return;
-	}
-
-	if (!itemconfig) return;
-	botimport.Print(PRT_MESSAGE, "itemtype %s \n", itemconfig->iteminfo[spoton_li->iteminfo].classname );
-}
-
-void GetNextItemNumber(int *ent, int *goal){
-	// if not inside the chain, go to start
-	if(spoton_li == NULL){
-		if(levelitems == NULL){	// no list? no number
-			*ent = 0;
-			return;	
-		}
-		else	spoton_li = levelitems;
-	}
-	else	// move along the chain
-		spoton_li = spoton_li->prev;
-	
-	// reached end of list?
-	if(spoton_li == NULL){
-		*ent = 0;
-		return;
-	}
-
-	*ent = spoton_li->entitynum;
-	*goal = spoton_li->goalareanum;
-	return;		
-}
-
-//cyr}
+//========================================================================
+//cyr{
 
+void PrintCurItemInfo(){
+	if(spoton_li == NULL){
+		botimport.Print(PRT_MESSAGE, "no item\n");
+		return;
+	}
+
+	if (!itemconfig) return;
+	botimport.Print(PRT_MESSAGE, "itemtype %s \n", itemconfig->iteminfo[spoton_li->iteminfo].classname );
+}
+
+void GetNextItemNumber(int *ent, int *goal){
+	// if not inside the chain, go to start
+	if(spoton_li == NULL){
+		if(levelitems == NULL){	// no list? no number
+			*ent = 0;
+			return;	
+		}
+		else	spoton_li = levelitems;
+	}
+	else	// move along the chain
+		spoton_li = spoton_li->prev;
+	
+	// reached end of list?
+	if(spoton_li == NULL){
+		*ent = 0;
+		return;
+	}
+
+	*ent = spoton_li->entitynum;
+	*goal = spoton_li->goalareanum;
+	return;		
+}
+
+//cyr}
+
 bot_goalstate_t *BotGoalStateFromHandle(int handle)
 {
 	if (handle <= 0 || handle > MAX_CLIENTS)
@@ -1328,24 +1328,24 @@
 	levelitem_t *li, *bestitem;
 	bot_goal_t goal;
 	bot_goalstate_t *gs;
-
-	// cyr
-	int j=0;
-	char info[1024]="0\\test\\";
-	//char strtmp[1024];
-	qboolean setcs = qfalse;
-	float fuzzweight;	// weight without distance scaling
-	float roamfactor = (float) LibVarGetValue("roamfactor") / 100;
-	//vec3_t amins ={-8,-8,-8};
-	//vec3_t amaxs ={8,8,8};
-
-
-	//botimport.Print(PRT_MESSAGE, "roamfactor is %.1f \n", roamfactor);
-	//AAS_ClearShownDebugLines();
-
-	setcs = LibVarGetValue("showitemweights");	// cyr
-
 
+	// cyr
+	int j=0;
+	char info[1024]="0\\test\\";
+	//char strtmp[1024];
+	qboolean setcs = qfalse;
+	float fuzzweight;	// weight without distance scaling
+	float roamfactor = (float) LibVarGetValue("roamfactor") / 100;
+	//vec3_t amins ={-8,-8,-8};
+	//vec3_t amaxs ={8,8,8};
+
+
+	//botimport.Print(PRT_MESSAGE, "roamfactor is %.1f \n", roamfactor);
+	//AAS_ClearShownDebugLines();
+
+	setcs = LibVarGetValue("showitemweights");	// cyr
+
+
 	gs = BotGoalStateFromHandle(goalstate);
 	if (!gs)
 		return qfalse;
@@ -1401,15 +1401,15 @@
 		if (weightnum < 0)
 			continue;
 
-		weight = FuzzyWeightUndecided(inventory, gs->itemweightconfig, weightnum);
-
-		fuzzweight = weight;	// cyr, keep a copy for debug print
-
-		//use weight scale for item_botroam
-		if (li->flags & IFL_ROAM){
-			weight *= li->weight * roamfactor;
-			//AAS_ShowBoundingBox(li->goalorigin, amins, amaxs);	// cyr
-		}
+		weight = FuzzyWeightUndecided(inventory, gs->itemweightconfig, weightnum);
+
+		fuzzweight = weight;	// cyr, keep a copy for debug print
+
+		//use weight scale for item_botroam
+		if (li->flags & IFL_ROAM){
+			weight *= li->weight * roamfactor;
+			//AAS_ShowBoundingBox(li->goalorigin, amins, amaxs);	// cyr
+		}
 		//
 		if (weight > 0)
 		{
@@ -1432,9 +1432,9 @@
 				} //end if
 			} //end if
 		} //end if
-		// cyr.. write to infostring
-		if(setcs && weight > 10 && strlen(info) < 900 )
-			strcat(info, va("%d\\%s: %.1f\\",j++, iteminfo->name/*, fuzzweight*/, weight) );
+		// cyr.. write to infostring
+		if(setcs && weight > 10 && strlen(info) < 900 )
+			strcat(info, va("%d\\%s: %.1f\\",j++, iteminfo->name/*, fuzzweight*/, weight) );
 	} //end for
 	//if no goal item found
 	if (!bestitem)
@@ -1463,9 +1463,9 @@
 		*/
 		return qfalse;
 	} //end if
-	if(setcs)
-		botimport.SetConfigString(inventory[2], info);	// cyr	
-		//botimport.Print(PRT_MESSAGE, "sending info string: %s\n\n", info);
+	if(setcs)
+		botimport.SetConfigString(inventory[2], info);	// cyr	
+		//botimport.Print(PRT_MESSAGE, "sending info string: %s\n\n", info);
 	//create a bot goal for this item
 	iteminfo = &ic->iteminfo[bestitem->iteminfo];
 	VectorCopy(bestitem->goalorigin, goal.origin);
@@ -1516,7 +1516,7 @@
 	levelitem_t *li, *bestitem;
 	bot_goal_t goal;
 	bot_goalstate_t *gs;
-	float roamfactor = (float) LibVarGetValue("roamfactor") / 100;
+	float roamfactor = (float) LibVarGetValue("roamfactor") / 100;
 
 	gs = BotGoalStateFromHandle(goalstate);
 	if (!gs)
@@ -1576,11 +1576,11 @@
 		if (weightnum < 0)
 			continue;
 		//
- 		weight = FuzzyWeightUndecided(inventory, gs->itemweightconfig, weightnum);
-
- 		//use weight scale for item_botroam
-		if (li->flags & IFL_ROAM) 
-			weight = roamfactor * li->weight * weight;	// cyr
+ 		weight = FuzzyWeightUndecided(inventory, gs->itemweightconfig, weightnum);
+
+ 		//use weight scale for item_botroam
+		if (li->flags & IFL_ROAM) 
+			weight = roamfactor * li->weight * weight;	// cyr
 		//
 		if (weight > 0)
 		{
Index: code/botlib/be_ai_weap.c
===================================================================
--- code/botlib/be_ai_weap.c	(revision 15)
+++ code/botlib/be_ai_weap.c	(working copy)
@@ -407,14 +407,14 @@
 	float weight, bestweight;
 	weaponconfig_t *wc;
 	bot_weaponstate_t *ws;
-	// cyr
-	int j=0;
-	qboolean setcs = qfalse;
-	char info[1024]="0\\test\\";
-//	char* cs;
-
-	setcs = LibVarGetValue("showweaponweights");	// cyr
+	// cyr
+	int j=0;
+	qboolean setcs = qfalse;
+	char info[1024]="0\\test\\";
+//	char* cs;
 
+	setcs = LibVarGetValue("showweaponweights");	// cyr
+
 	ws = BotWeaponStateFromHandle(weaponstate);
 	if (!ws) return 0;
 	wc = weaponconfig;
@@ -436,15 +436,15 @@
 			bestweight = weight;
 			bestweapon = i;
 		} //end if
-		if(setcs && weight){	// cyr.. write to infostring
-			strcat(info, va("%d\\%s: %.1f\\",j++, wc->weaponinfo[i].name, weight) );
-		}
+		if(setcs && weight){	// cyr.. write to infostring
+			strcat(info, va("%d\\%s: %.1f\\",j++, wc->weaponinfo[i].name, weight) );
+		}
 	} //end for
-	// cyr
-	if(setcs){
-		botimport.SetConfigString(inventory[2], info/*va("1\\%s\\2\\%s","hello world","its me")*/ );	// cyr	
-	//botimport.Print(PRT_MESSAGE, "sending info string: %s\n\n", info);
-	}
+	// cyr
+	if(setcs){
+		botimport.SetConfigString(inventory[2], info/*va("1\\%s\\2\\%s","hello world","its me")*/ );	// cyr	
+	//botimport.Print(PRT_MESSAGE, "sending info string: %s\n\n", info);
+	}
 	return bestweapon;
 } //end of the function BotChooseBestFightWeapon
 //===========================================================================
Index: code/botlib/botlib.h
===================================================================
--- code/botlib/botlib.h	(revision 15)
+++ code/botlib/botlib.h	(working copy)
@@ -202,8 +202,8 @@
 	//
 	int			(*DebugPolygonCreate)(int color, int numPoints, vec3_t *points);
 	void		(*DebugPolygonDelete)(int id);
-	// cyr
-	void		(*SetConfigString)(int index, const char *val);
+	// cyr
+	void		(*SetConfigString)(int index, const char *val);
 } botlib_import_t;
 
 typedef struct aas_export_s
Index: code/botlib/be_aas_debug.c
===================================================================
--- code/botlib/be_aas_debug.c	(revision 15)
+++ code/botlib/be_aas_debug.c	(working copy)
@@ -410,32 +410,32 @@
 		return;
 	} //end if
 	//pointer to the convex area
-	area = &aasworld.areas[areanum];
-
-	// cyr: aas created with -optimize has no faces or edges, show at least a rough box
-	if( !area->numfaces ){
-		vec3_t tmp, tmp2;
-		// aas was compiled using -optimize.. no faces, no edges
-		if(!groundfacesonly){
-			VectorSet(tmp, 0, 0, 0);
-			AAS_ShowBoundingBox(tmp, area->mins, area->maxs);
-		}
-		else{
-			VectorCopy(area->maxs, tmp);
-			tmp[2] = area->mins[2];
-			VectorCopy(tmp, tmp2);
-
-			tmp[0] = area->mins[0];
-			AAS_DebugLine(area->mins, tmp, LINECOLOR_GREEN );
-			AAS_DebugLine(tmp, tmp2, LINECOLOR_GREEN );
-			tmp[0] = area->maxs[0];
-			tmp[1] = area->mins[1];
-			AAS_DebugLine(area->mins, tmp, LINECOLOR_GREEN );
-			AAS_DebugLine(tmp, tmp2, LINECOLOR_GREEN );
-		}
-		return;
-	}
+	area = &aasworld.areas[areanum];
 
+	// cyr: aas created with -optimize has no faces or edges, show at least a rough box
+	if( !area->numfaces ){
+		vec3_t tmp, tmp2;
+		// aas was compiled using -optimize.. no faces, no edges
+		if(!groundfacesonly){
+			VectorSet(tmp, 0, 0, 0);
+			AAS_ShowBoundingBox(tmp, area->mins, area->maxs);
+		}
+		else{
+			VectorCopy(area->maxs, tmp);
+			tmp[2] = area->mins[2];
+			VectorCopy(tmp, tmp2);
+
+			tmp[0] = area->mins[0];
+			AAS_DebugLine(area->mins, tmp, LINECOLOR_GREEN );
+			AAS_DebugLine(tmp, tmp2, LINECOLOR_GREEN );
+			tmp[0] = area->maxs[0];
+			tmp[1] = area->mins[1];
+			AAS_DebugLine(area->mins, tmp, LINECOLOR_GREEN );
+			AAS_DebugLine(tmp, tmp2, LINECOLOR_GREEN );
+		}
+		return;
+	}
+
 	//walk through the faces of the area
 	for (i = 0; i < area->numfaces; i++)
 	{
Index: code/botlib/be_aas_route.c
===================================================================
--- code/botlib/be_aas_route.c	(revision 15)
+++ code/botlib/be_aas_route.c	(working copy)
@@ -878,10 +878,10 @@
 	//allocate memory for the portal update fields
 	aasworld.portalupdate = (aas_routingupdate_t *) GetClearedMemory(
 									(aasworld.numportals+1) * sizeof(aas_routingupdate_t));
-	// cyr: alloc fib array A
-    if (aasworld.fibA) FreeMemory(aasworld.fibA);
-    aasworld.fibA = (aas_routingupdate_t **) GetClearedMemory(
-                            maxreachabilityareas * sizeof(aas_routingupdate_t*));
+	// cyr: alloc fib array A
+    if (aasworld.fibA) FreeMemory(aasworld.fibA);
+    aasworld.fibA = (aas_routingupdate_t **) GetClearedMemory(
+                            maxreachabilityareas * sizeof(aas_routingupdate_t*));
 } //end of the function AAS_InitRoutingUpdate
 //===========================================================================
 //
@@ -1272,8 +1272,8 @@
 	if (aasworld.areaupdate) FreeMemory(aasworld.areaupdate);
 	aasworld.areaupdate = NULL;
 	if (aasworld.portalupdate) FreeMemory(aasworld.portalupdate);
-	aasworld.portalupdate = NULL;
-	if (aasworld.fibA) FreeMemory(aasworld.fibA);   // cyr
+	aasworld.portalupdate = NULL;
+	if (aasworld.fibA) FreeMemory(aasworld.fibA);   // cyr
     aasworld.fibA = NULL;                           // cyr
 	// free lists with areas the reachabilities go through
 	if (aasworld.reachabilityareas) FreeMemory(aasworld.reachabilityareas);
@@ -1292,293 +1292,293 @@
 // Returns:				-
 // Changes Globals:		-
 //===========================================================================
-// cyr{
-void InsertAfter( aas_routingupdate_t* a, aas_routingupdate_t* b){
-    if (a == a->fib_right) {
-        a->fib_right = b;
-        a->fib_left = b;
-        b->fib_right = a;
-        b->fib_left = a;
-    } else {
-        b->fib_right = a->fib_right;
-        a->fib_right->fib_left = b;
-        a->fib_right = b;
-        b->fib_left = a;
-    }
-}
-
-InsertToRoot( MyQueue_t* Q, aas_routingupdate_t* cur){
-    if (Q->proot == NULL)
-        Q->proot = cur->fib_left = cur->fib_right = cur;
-    else
-        InsertAfter(Q->proot, cur);
-}
-
-Insert(MyQueue_t* Q, aas_routingupdate_t* cur){
-    InsertToRoot(Q, cur);
-    // update min pointer
-    if( Q->pmin==NULL || Q->pmin->tmptraveltime > cur->tmptraveltime)
-        Q->pmin = cur;
-    Q->size++;
-}
-
-AddToQueue(MyQueue_t* Q, aas_routingupdate_t* cur){ // tmptraveltime muss vorher gesetzt werden !
-    cur->fib_parent = NULL;
-    cur->fib_child = NULL;
-    cur->fib_degree = 0;
-    cur->fib_mark = qfalse;
-    Insert(Q,cur);
-}
-
-aas_routingupdate_t* UnlinkFromQueue( aas_routingupdate_t* cur ){
-    aas_routingupdate_t* ret;   // left sibling
-
-    if (cur == cur->fib_left)
-        ret = NULL;
-    else
-        ret = cur->fib_left;
-
-    // if parents son pointer is on me, redirect to left sibling
-    if (cur->fib_parent != NULL && cur->fib_parent->fib_child == cur)
-        cur->fib_parent->fib_child = ret;
-
-    cur->fib_right->fib_left = cur->fib_left;
-    cur->fib_left->fib_right = cur->fib_right;
-
-    return ret; //(aas_routingupdate_t*)
-}
-
-void Queue_Cut( MyQueue_t* Q, aas_routingupdate_t* cur, aas_routingupdate_t* mother){
-    // entferne x aus der sohnliste von y
-    UnlinkFromQueue(cur);
-    mother->fib_degree--;
-    InsertToRoot(Q, cur);
-    cur->fib_parent = NULL;     // better put this into InsertToRoot ? TODO
-    cur->fib_mark = qfalse;
-}
-
-void Queue_Cascading_Cut( MyQueue_t* Q, aas_routingupdate_t* y){
-    aas_routingupdate_t* z = y->fib_parent;
-    while( z != NULL ){
-        if( y->fib_mark == qtrue ){
-            Queue_Cut(Q, y, z);
-            // bubble up
-            y = z;
-            z = y->fib_parent;
-        }
-        else{
-            y->fib_mark = qtrue;
-            return;
-        }
-    }
-}
-
-qboolean Queue_DecreaseKey( MyQueue_t* Q, aas_routingupdate_t* cur){
-    aas_routingupdate_t* tmp;
-
-    // tmptraveltime is updated and quaranteed to be smaller than former value
-    tmp = cur->fib_parent;
-    // bubble up if smaller than parent
-    if(tmp!=NULL && cur->tmptraveltime < tmp->tmptraveltime){
-        Queue_Cut(Q, cur, tmp);
-        Queue_Cascading_Cut(Q, tmp);
-    }
-    // update global minimum
-    if(cur->tmptraveltime < Q->pmin->tmptraveltime)
-        Q->pmin = cur;
-
-    return qtrue;
-}
-
-
-void QueueLink(aas_routingupdate_t* mother, aas_routingupdate_t* kid){
-    // make y a child of x
-    if (mother->fib_child == NULL){
-        mother->fib_child = kid;
-        kid->fib_left = kid->fib_right = kid;
-    }
-    else
-        InsertAfter(mother->fib_child->fib_left, kid);  // == InsertBefore
-    kid->fib_parent = mother;
-    mother->fib_degree++;
-    kid->fib_mark = qfalse;
-}
-
-Queue_CleanUp(MyQueue_t* Q, qboolean logme){
-    int deg;
-    int i;
-    aas_routingupdate_t* tmp1;
-    aas_routingupdate_t* tmp2;
-    aas_routingupdate_t* tmp3;
-
-    // array A null setzen
-    memset(aasworld.fibA, 0, sizeof(aas_routingupdate_t*) * Q->size );
-
-    // main loop
-    //iteriere über elemente it der wurzelliste
-    while(Q->proot != NULL){
-        tmp1 = Q->proot;
-        deg = Q->proot->fib_degree;
-        // entferne proot aus wurzelliste
-        if (Q->proot->fib_left == Q->proot)
-             Q->proot = NULL;
-        else{
-            Q->proot = UnlinkFromQueue(Q->proot);
-        }
-        // es sitzt schon ein entferntes listenelement auf der gewünschten position...
-        // -> füge das element mit dem grösseren schlüssel zu den childs des anderen..
-        // dadurch ändert sich der grad -> wieder pos prüfen
-        while( aasworld.fibA[deg] != NULL){
-            tmp2 = aasworld.fibA[deg];
-            // make tmp1 the smaller traveltime
-            if( tmp2->tmptraveltime < tmp1->tmptraveltime){ // swap
-                tmp3=tmp1;  tmp1=tmp2;  tmp2=tmp3;
-            }
-            // füge tmp2 zu den söhnen von tmp1
-            QueueLink(tmp1, tmp2);
-            aasworld.fibA[deg] = NULL;
-            deg++;
-        }
-        // füge entferntes listenelement in array ein
-        aasworld.fibA[deg] = tmp1;
-    }
-    // create new root list from aasworld.fibA
-    Q->pmin = NULL;
-    for(i=0; i < Q->size;i++){
-        if(aasworld.fibA[i]!=NULL){
-            //füge aasworld.fibA[i] zur wurzelliste
-            InsertToRoot(Q, aasworld.fibA[i]);
-            // min updaten
-            if(Q->pmin == NULL || aasworld.fibA[i]->tmptraveltime < Q->pmin->tmptraveltime )
-                    Q->pmin = aasworld.fibA[i];
-        }
-    }
-}
-
-aas_routingupdate_t* QueueExtractMin( MyQueue_t* Q, qboolean logme){
-    aas_routingupdate_t* ret = Q->pmin;
-    aas_routingupdate_t* son = NULL;
-    aas_routingupdate_t* it;    // iterator
-    aas_routingupdate_t* next;
-
-    if(ret != NULL){
-        // add all min's childs to  the root list
-        for(it= ret->fib_child; it!=son && it != NULL;){
-            if(son==NULL) son = it; // init son at cycle start point
-            next = it->fib_right;
-            InsertToRoot(Q, it);
-            it->fib_parent = NULL;
-            it = next;
-        }
-        // entferne ret aus wurzelliste
-        if (ret->fib_left == ret) Q->proot = NULL;
-        else Q->proot = UnlinkFromQueue(ret);
-
-        // update min and recalc
-        if(ret == ret->fib_right)   // ret is the only element Q
-            Q->pmin = NULL;
-        else{
-            Q->pmin = ret->fib_right;
-            Queue_CleanUp(Q, logme);
-        }
-        Q->size--;
-    }
-    return ret;
-}
-
-#define TT_INF 32767    // unsigned short max
-void AAS_UpdateAreaRoutingCache(aas_routingcache_t *areacache){
-    int i, clusterareanum, cluster, numreachabilityareas;
-    int badtravelflags, linknum, nextareanum;
-    unsigned short int startareatraveltimes[128], t;
-    aas_routingupdate_t* curupdate;
-    aas_reachability_t *reach;
-    aas_reversedreachability_t *revreach;
-    aas_reversedlink_t *revlink;
-    MyQueue_t Q;
-
-    numreachabilityareas = aasworld.clusters[areacache->cluster].numreachabilityareas;
-
-    // sanity check
-    clusterareanum = AAS_ClusterAreaNum(areacache->cluster, areacache->areanum);
-    if (clusterareanum >= numreachabilityareas) return;
-    // traveltime from destination area is given
-    areacache->traveltimes[clusterareanum] = areacache->starttraveltime;
-    badtravelflags = ~areacache->travelflags;
-
-
-    // preinit routingupdate objects
-    for(i=0; i<aasworld.clusters[areacache->cluster].numreachabilityareas; i++)
-        aasworld.areaupdate[i].tmptraveltime = TT_INF;  // i= clusterarenum
-
-    // traveltimes inside goal area
-    Com_Memset(startareatraveltimes, 0, sizeof(startareatraveltimes));
-
-    // init Q
-    Q.proot = NULL; Q.pmin = NULL;  Q.size = 0;
-
-    // add goal area to the list
-    aasworld.areaupdate[clusterareanum].areanum = areacache->areanum;
-    aasworld.areaupdate[clusterareanum].areatraveltimes = startareatraveltimes;
-    aasworld.areaupdate[clusterareanum].tmptraveltime = areacache->starttraveltime;
-    AddToQueue( &Q, &aasworld.areaupdate[clusterareanum] ); // inlist true setzen Q_INQUEUE
-
-    while( Q.size ){    // nonempty
-        // get pointer to nearest area, take it out of the queue
-        curupdate = QueueExtractMin(&Q,qtrue);
-        // iterate over all reachabilities, update traveltimes
-        revreach = &aasworld.reversedreachability[curupdate->areanum];
-        //
-        for (i = 0, revlink = revreach->first; revlink; revlink = revlink->next, i++)
-        {
-            linknum = revlink->linknum;
-            reach = &aasworld.reachability[linknum];
-            //if there is used an undesired travel type
-            if (AAS_TravelFlagForType_inline(reach->traveltype) & badtravelflags) continue;
-            //if not allowed to enter the next area
-            if (aasworld.areasettings[reach->areanum].areaflags & AREA_DISABLED) continue;
-            //if the next area has a not allowed travel flag
-            if (AAS_AreaContentsTravelFlags_inline(reach->areanum) & badtravelflags) continue;
-            //number of the area the reversed reachability leads to
-            nextareanum = revlink->areanum;
-            //get the cluster number of the area
-            cluster = aasworld.areasettings[nextareanum].cluster;
-            //don't leave the cluster
-            if (cluster > 0 && cluster != areacache->cluster) continue;
-            //get the number of the area in the cluster
-            clusterareanum = AAS_ClusterAreaNum(areacache->cluster, nextareanum);
-            if (clusterareanum >= numreachabilityareas) continue;
-            //time already travelled plus the traveltime through
-            //the current area plus the travel time from the reachability
-            t = curupdate->tmptraveltime +
-                        //AAS_AreaTravelTime(curupdate->areanum, curupdate->start, reach->end) +
-                        curupdate->areatraveltimes[i] +
-                            reach->traveltime;
-
-            if (aasworld.areaupdate[clusterareanum].tmptraveltime == TT_INF ){
-                aasworld.areaupdate[clusterareanum].areanum = nextareanum;
-                aasworld.areaupdate[clusterareanum].tmptraveltime = t;
-                aasworld.areaupdate[clusterareanum].areatraveltimes = aasworld.areatraveltimes[nextareanum][linknum -
-                                                    aasworld.areasettings[nextareanum].firstreachablearea];
-                AddToQueue( &Q, &aasworld.areaupdate[clusterareanum] );
-                // store new best values
-                areacache->traveltimes[clusterareanum] = t;
-                areacache->reachabilities[clusterareanum] = linknum - aasworld.areasettings[nextareanum].firstreachablearea;
-            }
-            // already in the queue, update value
-            else if(areacache->traveltimes[clusterareanum] > t){
-                // areanum is already set
-                aasworld.areaupdate[clusterareanum].tmptraveltime = t;
-                aasworld.areaupdate[clusterareanum].areatraveltimes = aasworld.areatraveltimes[nextareanum][linknum -
-                                                    aasworld.areasettings[nextareanum].firstreachablearea];
-                Queue_DecreaseKey( &Q, &aasworld.areaupdate[clusterareanum]);
-                // store new best values
-                areacache->traveltimes[clusterareanum] = t;
-                areacache->reachabilities[clusterareanum] = linknum - aasworld.areasettings[nextareanum].firstreachablearea;
-            }
-        }// end for
-    }
-}
+// cyr{
+void InsertAfter( aas_routingupdate_t* a, aas_routingupdate_t* b){
+    if (a == a->fib_right) {
+        a->fib_right = b;
+        a->fib_left = b;
+        b->fib_right = a;
+        b->fib_left = a;
+    } else {
+        b->fib_right = a->fib_right;
+        a->fib_right->fib_left = b;
+        a->fib_right = b;
+        b->fib_left = a;
+    }
+}
+
+void InsertToRoot( MyQueue_t* Q, aas_routingupdate_t* cur){
+    if (Q->proot == NULL)
+        Q->proot = cur->fib_left = cur->fib_right = cur;
+    else
+        InsertAfter(Q->proot, cur);
+}
+
+void Insert(MyQueue_t* Q, aas_routingupdate_t* cur){
+    InsertToRoot(Q, cur);
+    // update min pointer
+    if( Q->pmin==NULL || Q->pmin->tmptraveltime > cur->tmptraveltime)
+        Q->pmin = cur;
+    Q->size++;
+}
+
+void AddToQueue(MyQueue_t* Q, aas_routingupdate_t* cur){ // tmptraveltime muss vorher gesetzt werden !
+    cur->fib_parent = NULL;
+    cur->fib_child = NULL;
+    cur->fib_degree = 0;
+    cur->fib_mark = qfalse;
+    Insert(Q,cur);
+}
+
+aas_routingupdate_t* UnlinkFromQueue( aas_routingupdate_t* cur ){
+    aas_routingupdate_t* ret;   // left sibling
+
+    if (cur == cur->fib_left)
+        ret = NULL;
+    else
+        ret = cur->fib_left;
+
+    // if parents son pointer is on me, redirect to left sibling
+    if (cur->fib_parent != NULL && cur->fib_parent->fib_child == cur)
+        cur->fib_parent->fib_child = ret;
+
+    cur->fib_right->fib_left = cur->fib_left;
+    cur->fib_left->fib_right = cur->fib_right;
+
+    return ret; //(aas_routingupdate_t*)
+}
+
+void Queue_Cut( MyQueue_t* Q, aas_routingupdate_t* cur, aas_routingupdate_t* mother){
+    // entferne x aus der sohnliste von y
+    UnlinkFromQueue(cur);
+    mother->fib_degree--;
+    InsertToRoot(Q, cur);
+    cur->fib_parent = NULL;     // better put this into InsertToRoot ? TODO
+    cur->fib_mark = qfalse;
+}
+
+void Queue_Cascading_Cut( MyQueue_t* Q, aas_routingupdate_t* y){
+    aas_routingupdate_t* z = y->fib_parent;
+    while( z != NULL ){
+        if( y->fib_mark == qtrue ){
+            Queue_Cut(Q, y, z);
+            // bubble up
+            y = z;
+            z = y->fib_parent;
+        }
+        else{
+            y->fib_mark = qtrue;
+            return;
+        }
+    }
+}
+
+qboolean Queue_DecreaseKey( MyQueue_t* Q, aas_routingupdate_t* cur){
+    aas_routingupdate_t* tmp;
+
+    // tmptraveltime is updated and quaranteed to be smaller than former value
+    tmp = cur->fib_parent;
+    // bubble up if smaller than parent
+    if(tmp!=NULL && cur->tmptraveltime < tmp->tmptraveltime){
+        Queue_Cut(Q, cur, tmp);
+        Queue_Cascading_Cut(Q, tmp);
+    }
+    // update global minimum
+    if(cur->tmptraveltime < Q->pmin->tmptraveltime)
+        Q->pmin = cur;
+
+    return qtrue;
+}
+
+
+void QueueLink(aas_routingupdate_t* mother, aas_routingupdate_t* kid){
+    // make y a child of x
+    if (mother->fib_child == NULL){
+        mother->fib_child = kid;
+        kid->fib_left = kid->fib_right = kid;
+    }
+    else
+        InsertAfter(mother->fib_child->fib_left, kid);  // == InsertBefore
+    kid->fib_parent = mother;
+    mother->fib_degree++;
+    kid->fib_mark = qfalse;
+}
+
+void Queue_CleanUp(MyQueue_t* Q, qboolean logme){
+    int deg;
+    int i;
+    aas_routingupdate_t* tmp1;
+    aas_routingupdate_t* tmp2;
+    aas_routingupdate_t* tmp3;
+
+    // array A null setzen
+    memset(aasworld.fibA, 0, sizeof(aas_routingupdate_t*) * Q->size );
+
+    // main loop
+    //iteriere über elemente it der wurzelliste
+    while(Q->proot != NULL){
+        tmp1 = Q->proot;
+        deg = Q->proot->fib_degree;
+        // entferne proot aus wurzelliste
+        if (Q->proot->fib_left == Q->proot)
+             Q->proot = NULL;
+        else{
+            Q->proot = UnlinkFromQueue(Q->proot);
+        }
+        // es sitzt schon ein entferntes listenelement auf der gewünschten position...
+        // -> füge das element mit dem grösseren schlüssel zu den childs des anderen..
+        // dadurch ändert sich der grad -> wieder pos prüfen
+        while( aasworld.fibA[deg] != NULL){
+            tmp2 = aasworld.fibA[deg];
+            // make tmp1 the smaller traveltime
+            if( tmp2->tmptraveltime < tmp1->tmptraveltime){ // swap
+                tmp3=tmp1;  tmp1=tmp2;  tmp2=tmp3;
+            }
+            // füge tmp2 zu den söhnen von tmp1
+            QueueLink(tmp1, tmp2);
+            aasworld.fibA[deg] = NULL;
+            deg++;
+        }
+        // füge entferntes listenelement in array ein
+        aasworld.fibA[deg] = tmp1;
+    }
+    // create new root list from aasworld.fibA
+    Q->pmin = NULL;
+    for(i=0; i < Q->size;i++){
+        if(aasworld.fibA[i]!=NULL){
+            //füge aasworld.fibA[i] zur wurzelliste
+            InsertToRoot(Q, aasworld.fibA[i]);
+            // min updaten
+            if(Q->pmin == NULL || aasworld.fibA[i]->tmptraveltime < Q->pmin->tmptraveltime )
+                    Q->pmin = aasworld.fibA[i];
+        }
+    }
+}
+
+aas_routingupdate_t* QueueExtractMin( MyQueue_t* Q, qboolean logme){
+    aas_routingupdate_t* ret = Q->pmin;
+    aas_routingupdate_t* son = NULL;
+    aas_routingupdate_t* it;    // iterator
+    aas_routingupdate_t* next;
+
+    if(ret != NULL){
+        // add all min's childs to  the root list
+        for(it= ret->fib_child; it!=son && it != NULL;){
+            if(son==NULL) son = it; // init son at cycle start point
+            next = it->fib_right;
+            InsertToRoot(Q, it);
+            it->fib_parent = NULL;
+            it = next;
+        }
+        // entferne ret aus wurzelliste
+        if (ret->fib_left == ret) Q->proot = NULL;
+        else Q->proot = UnlinkFromQueue(ret);
+
+        // update min and recalc
+        if(ret == ret->fib_right)   // ret is the only element Q
+            Q->pmin = NULL;
+        else{
+            Q->pmin = ret->fib_right;
+            Queue_CleanUp(Q, logme);
+        }
+        Q->size--;
+    }
+    return ret;
+}
+
+#define TT_INF 32767    // unsigned short max
+void AAS_UpdateAreaRoutingCache(aas_routingcache_t *areacache){
+    int i, clusterareanum, cluster, numreachabilityareas;
+    int badtravelflags, linknum, nextareanum;
+    unsigned short int startareatraveltimes[128], t;
+    aas_routingupdate_t* curupdate;
+    aas_reachability_t *reach;
+    aas_reversedreachability_t *revreach;
+    aas_reversedlink_t *revlink;
+    MyQueue_t Q;
+
+    numreachabilityareas = aasworld.clusters[areacache->cluster].numreachabilityareas;
+
+    // sanity check
+    clusterareanum = AAS_ClusterAreaNum(areacache->cluster, areacache->areanum);
+    if (clusterareanum >= numreachabilityareas) return;
+    // traveltime from destination area is given
+    areacache->traveltimes[clusterareanum] = areacache->starttraveltime;
+    badtravelflags = ~areacache->travelflags;
+
+
+    // preinit routingupdate objects
+    for(i=0; i<aasworld.clusters[areacache->cluster].numreachabilityareas; i++)
+        aasworld.areaupdate[i].tmptraveltime = TT_INF;  // i= clusterarenum
+
+    // traveltimes inside goal area
+    Com_Memset(startareatraveltimes, 0, sizeof(startareatraveltimes));
+
+    // init Q
+    Q.proot = NULL; Q.pmin = NULL;  Q.size = 0;
+
+    // add goal area to the list
+    aasworld.areaupdate[clusterareanum].areanum = areacache->areanum;
+    aasworld.areaupdate[clusterareanum].areatraveltimes = startareatraveltimes;
+    aasworld.areaupdate[clusterareanum].tmptraveltime = areacache->starttraveltime;
+    AddToQueue( &Q, &aasworld.areaupdate[clusterareanum] ); // inlist true setzen Q_INQUEUE
+
+    while( Q.size ){    // nonempty
+        // get pointer to nearest area, take it out of the queue
+        curupdate = QueueExtractMin(&Q,qtrue);
+        // iterate over all reachabilities, update traveltimes
+        revreach = &aasworld.reversedreachability[curupdate->areanum];
+        //
+        for (i = 0, revlink = revreach->first; revlink; revlink = revlink->next, i++)
+        {
+            linknum = revlink->linknum;
+            reach = &aasworld.reachability[linknum];
+            //if there is used an undesired travel type
+            if (AAS_TravelFlagForType_inline(reach->traveltype) & badtravelflags) continue;
+            //if not allowed to enter the next area
+            if (aasworld.areasettings[reach->areanum].areaflags & AREA_DISABLED) continue;
+            //if the next area has a not allowed travel flag
+            if (AAS_AreaContentsTravelFlags_inline(reach->areanum) & badtravelflags) continue;
+            //number of the area the reversed reachability leads to
+            nextareanum = revlink->areanum;
+            //get the cluster number of the area
+            cluster = aasworld.areasettings[nextareanum].cluster;
+            //don't leave the cluster
+            if (cluster > 0 && cluster != areacache->cluster) continue;
+            //get the number of the area in the cluster
+            clusterareanum = AAS_ClusterAreaNum(areacache->cluster, nextareanum);
+            if (clusterareanum >= numreachabilityareas) continue;
+            //time already travelled plus the traveltime through
+            //the current area plus the travel time from the reachability
+            t = curupdate->tmptraveltime +
+                        //AAS_AreaTravelTime(curupdate->areanum, curupdate->start, reach->end) +
+                        curupdate->areatraveltimes[i] +
+                            reach->traveltime;
+
+            if (aasworld.areaupdate[clusterareanum].tmptraveltime == TT_INF ){
+                aasworld.areaupdate[clusterareanum].areanum = nextareanum;
+                aasworld.areaupdate[clusterareanum].tmptraveltime = t;
+                aasworld.areaupdate[clusterareanum].areatraveltimes = aasworld.areatraveltimes[nextareanum][linknum -
+                                                    aasworld.areasettings[nextareanum].firstreachablearea];
+                AddToQueue( &Q, &aasworld.areaupdate[clusterareanum] );
+                // store new best values
+                areacache->traveltimes[clusterareanum] = t;
+                areacache->reachabilities[clusterareanum] = linknum - aasworld.areasettings[nextareanum].firstreachablearea;
+            }
+            // already in the queue, update value
+            else if(areacache->traveltimes[clusterareanum] > t){
+                // areanum is already set
+                aasworld.areaupdate[clusterareanum].tmptraveltime = t;
+                aasworld.areaupdate[clusterareanum].areatraveltimes = aasworld.areatraveltimes[nextareanum][linknum -
+                                                    aasworld.areasettings[nextareanum].firstreachablearea];
+                Queue_DecreaseKey( &Q, &aasworld.areaupdate[clusterareanum]);
+                // store new best values
+                areacache->traveltimes[clusterareanum] = t;
+                areacache->reachabilities[clusterareanum] = linknum - aasworld.areasettings[nextareanum].firstreachablearea;
+            }
+        }// end for
+    }
+}
 // cyr}
 //===========================================================================
 //
@@ -1632,100 +1632,100 @@
 // Returns:				-
 // Changes Globals:		-
 //===========================================================================
-// cyr{
-void AAS_UpdatePortalRoutingCache(aas_routingcache_t *portalcache)
-{
-    int i, portalnum, clusterareanum, clusternum;
-    unsigned short int t;
-    aas_portal_t *portal;
-    aas_cluster_t *cluster;
-    aas_routingcache_t *cache;
-    aas_routingupdate_t *updateliststart, *updatelistend, *curupdate, *nextupdate;
-
-#ifdef ROUTING_DEBUG
-    numportalcacheupdates++;
-#endif //ROUTING_DEBUG
-    //clear the routing update fields
-//  Com_Memset(aasworld.portalupdate, 0, (aasworld.numportals+1) * sizeof(aas_routingupdate_t));
-    //
-    curupdate = &aasworld.portalupdate[aasworld.numportals];
-    curupdate->cluster = portalcache->cluster;
-    curupdate->areanum = portalcache->areanum;
-    curupdate->tmptraveltime = portalcache->starttraveltime;
-    //if the start area is a cluster portal, store the travel time for that portal
-    clusternum = aasworld.areasettings[portalcache->areanum].cluster;
-    if (clusternum < 0)
-    {
-        portalcache->traveltimes[-clusternum] = portalcache->starttraveltime;
-    } //end if
-    //put the area to start with in the current read list
-    curupdate->fib_left = NULL;
-    curupdate->fib_right = NULL;
-    updateliststart = curupdate;
-    updatelistend = curupdate;
-    //while there are updates in the current list
-    while (updateliststart)
-    {
-        curupdate = updateliststart;
-        //remove the current update from the list
-        if (curupdate->fib_left) curupdate->fib_left->fib_right = NULL;
-        else updatelistend = NULL;
-        updateliststart = curupdate->fib_left;
-        //current update is removed from the list
-        curupdate->inlist = qfalse;
-        //
-        cluster = &aasworld.clusters[curupdate->cluster];
-        //
-        cache = AAS_GetAreaRoutingCache(curupdate->cluster,
-                                curupdate->areanum, portalcache->travelflags);
-        //take all portals of the cluster
-        for (i = 0; i < cluster->numportals; i++)
-        {
-            portalnum = aasworld.portalindex[cluster->firstportal + i];
-            portal = &aasworld.portals[portalnum];
-            //if this is the portal of the current update continue
-            if (portal->areanum == curupdate->areanum) continue;
-            //
-            clusterareanum = AAS_ClusterAreaNum(curupdate->cluster, portal->areanum);
-            if (clusterareanum >= cluster->numreachabilityareas) continue;
-            //
-            t = cache->traveltimes[clusterareanum];
-            if (!t) continue;
-            t += curupdate->tmptraveltime;
-            //
-            if (!portalcache->traveltimes[portalnum] ||
-                    portalcache->traveltimes[portalnum] > t)
-            {
-                portalcache->traveltimes[portalnum] = t;
-                nextupdate = &aasworld.portalupdate[portalnum];
-                if (portal->frontcluster == curupdate->cluster)
-                {
-                    nextupdate->cluster = portal->backcluster;
-                } //end if
-                else
-                {
-                    nextupdate->cluster = portal->frontcluster;
-                } //end else
-                nextupdate->areanum = portal->areanum;
-                //add travel time through the actual portal area for the next update
-                nextupdate->tmptraveltime = t + aasworld.portalmaxtraveltimes[portalnum];
-                if (!nextupdate->inlist)
-                {
-                    // we add the update to the end of the list
-                    // we could also use a B+ tree to have a real sorted list
-                    // on travel time which makes for faster routing updates
-                    nextupdate->fib_left = NULL;
-                    nextupdate->fib_right = updatelistend;
-                    if (updatelistend) updatelistend->fib_left = nextupdate;
-                    else updateliststart = nextupdate;
-                    updatelistend = nextupdate;
-                    nextupdate->inlist = qtrue;
-                } //end if
-            } //end if
-        } //end for
-    } //end while
-} //end of the function AAS_UpdatePortalRoutingCache
-
+// cyr{
+void AAS_UpdatePortalRoutingCache(aas_routingcache_t *portalcache)
+{
+    int i, portalnum, clusterareanum, clusternum;
+    unsigned short int t;
+    aas_portal_t *portal;
+    aas_cluster_t *cluster;
+    aas_routingcache_t *cache;
+    aas_routingupdate_t *updateliststart, *updatelistend, *curupdate, *nextupdate;
+
+#ifdef ROUTING_DEBUG
+    numportalcacheupdates++;
+#endif //ROUTING_DEBUG
+    //clear the routing update fields
+//  Com_Memset(aasworld.portalupdate, 0, (aasworld.numportals+1) * sizeof(aas_routingupdate_t));
+    //
+    curupdate = &aasworld.portalupdate[aasworld.numportals];
+    curupdate->cluster = portalcache->cluster;
+    curupdate->areanum = portalcache->areanum;
+    curupdate->tmptraveltime = portalcache->starttraveltime;
+    //if the start area is a cluster portal, store the travel time for that portal
+    clusternum = aasworld.areasettings[portalcache->areanum].cluster;
+    if (clusternum < 0)
+    {
+        portalcache->traveltimes[-clusternum] = portalcache->starttraveltime;
+    } //end if
+    //put the area to start with in the current read list
+    curupdate->fib_left = NULL;
+    curupdate->fib_right = NULL;
+    updateliststart = curupdate;
+    updatelistend = curupdate;
+    //while there are updates in the current list
+    while (updateliststart)
+    {
+        curupdate = updateliststart;
+        //remove the current update from the list
+        if (curupdate->fib_left) curupdate->fib_left->fib_right = NULL;
+        else updatelistend = NULL;
+        updateliststart = curupdate->fib_left;
+        //current update is removed from the list
+        curupdate->inlist = qfalse;
+        //
+        cluster = &aasworld.clusters[curupdate->cluster];
+        //
+        cache = AAS_GetAreaRoutingCache(curupdate->cluster,
+                                curupdate->areanum, portalcache->travelflags);
+        //take all portals of the cluster
+        for (i = 0; i < cluster->numportals; i++)
+        {
+            portalnum = aasworld.portalindex[cluster->firstportal + i];
+            portal = &aasworld.portals[portalnum];
+            //if this is the portal of the current update continue
+            if (portal->areanum == curupdate->areanum) continue;
+            //
+            clusterareanum = AAS_ClusterAreaNum(curupdate->cluster, portal->areanum);
+            if (clusterareanum >= cluster->numreachabilityareas) continue;
+            //
+            t = cache->traveltimes[clusterareanum];
+            if (!t) continue;
+            t += curupdate->tmptraveltime;
+            //
+            if (!portalcache->traveltimes[portalnum] ||
+                    portalcache->traveltimes[portalnum] > t)
+            {
+                portalcache->traveltimes[portalnum] = t;
+                nextupdate = &aasworld.portalupdate[portalnum];
+                if (portal->frontcluster == curupdate->cluster)
+                {
+                    nextupdate->cluster = portal->backcluster;
+                } //end if
+                else
+                {
+                    nextupdate->cluster = portal->frontcluster;
+                } //end else
+                nextupdate->areanum = portal->areanum;
+                //add travel time through the actual portal area for the next update
+                nextupdate->tmptraveltime = t + aasworld.portalmaxtraveltimes[portalnum];
+                if (!nextupdate->inlist)
+                {
+                    // we add the update to the end of the list
+                    // we could also use a B+ tree to have a real sorted list
+                    // on travel time which makes for faster routing updates
+                    nextupdate->fib_left = NULL;
+                    nextupdate->fib_right = updatelistend;
+                    if (updatelistend) updatelistend->fib_left = nextupdate;
+                    else updateliststart = nextupdate;
+                    updatelistend = nextupdate;
+                    nextupdate->inlist = qtrue;
+                } //end if
+            } //end if
+        } //end for
+    } //end while
+} //end of the function AAS_UpdatePortalRoutingCache
+
 // cyr}
 //===========================================================================
 //
Index: code/botlib/aasfile.h
===================================================================
--- code/botlib/aasfile.h	(revision 15)
+++ code/botlib/aasfile.h	(working copy)
@@ -243,12 +243,12 @@
 	//data entries
 	aas_lump_t lumps[AAS_LUMPS];
 } aas_header_t;
-
-// cyr
-void ShowRoute(int client, int goalent, int goalentarea,  int report);
-void GetNextItemNumber(int*, int*);
-void PrintCurItemInfo();
 
+// cyr
+void ShowRoute(int client, int goalent, int goalentarea,  int report);
+void GetNextItemNumber(int *, int *);
+void PrintCurItemInfo(void);
+
 //====== additional information ======
 /*
 
Index: code/botlib/be_aas_main.c
===================================================================
--- code/botlib/be_aas_main.c	(revision 15)
+++ code/botlib/be_aas_main.c	(working copy)
@@ -47,8 +47,8 @@
 aas_t aasworld;
 
 libvar_t *saveroutingcache;
-int showroute_ent = 0;	// cyr
-int showroute_entarea = 0;	// cyr
+int showroute_ent = 0;	// cyr
+int showroute_entarea = 0;	// cyr
 
 //===========================================================================
 //
@@ -229,67 +229,67 @@
 	AAS_InitRouting();
 	//at this point AAS is initialized
 	AAS_SetInitialized();
-} //end of the function AAS_ContinueInit
-
-//cyr
-void ShowReachesFrom(){
-	int reachnum, areanum;
-	aas_reachability_t reach;
-	vec3_t origin;
-	aas_entityinfo_t entinfo;
-
-	// client0 position
-	AAS_EntityInfo(0, &entinfo);
-	areanum = AAS_PointAreaNum(entinfo.origin);
-
-	VectorCopy(entinfo.origin, origin);
-	origin[2] -= 20;	// player height... how much is it?
-
-	if(!areanum) return;
-	for (reachnum = AAS_NextAreaReachability(areanum, 0); reachnum;
-		reachnum = AAS_NextAreaReachability(areanum, reachnum)){
-		
-		AAS_ReachabilityFromNum(reachnum, &reach);
-		
-		//AAS_DrawArrow(entinfo.origin, reach.start, LINECOLOR_BLUE, LINECOLOR_YELLOW);
-		AAS_DebugLine(origin, reach.start, LINECOLOR_YELLOW);
-		AAS_ShowReachability(&reach);
-		AAS_ShowArea(reach.areanum, qtrue);
-
-		//botimport.Print(PRT_MESSAGE, " towards area %d \n", reach.areanum);
-	}
-}
-
-void ShowReachesTo(){
-	int areanum;
-	aas_reachability_t* reach;
-//	vec3_t origin;
-	aas_entityinfo_t entinfo;
-	int linknum;
-	aas_reversedreachability_t *revreach;
-    aas_reversedlink_t *revlink;
-
-	// client0 position
-	AAS_EntityInfo(0, &entinfo);
-	areanum = AAS_PointAreaNum(entinfo.origin);
-
-	if(!areanum) return;
-	// iterate over all 
-	revreach = &aasworld.reversedreachability[areanum];
-        //
-        for (revlink = revreach->first; revlink; revlink = revlink->next){
-        	linknum = revlink->linknum;
-            reach = &aasworld.reachability[linknum];
-
-			//AAS_DrawArrow(entinfo.origin, reach->end, LINECOLOR_BLUE, LINECOLOR_YELLOW);
-			AAS_DebugLine(entinfo.origin, reach->end, LINECOLOR_BLUE);
-			AAS_ShowReachability(reach);
-			AAS_ShowArea(revlink->areanum, qtrue);
-
-			//botimport.Print(PRT_MESSAGE, " from area %d \n", revlink->areanum);
-        }
-}
+} //end of the function AAS_ContinueInit
 
+//cyr
+void ShowReachesFrom(void){
+	int reachnum, areanum;
+	aas_reachability_t reach;
+	vec3_t origin;
+	aas_entityinfo_t entinfo;
+
+	// client0 position
+	AAS_EntityInfo(0, &entinfo);
+	areanum = AAS_PointAreaNum(entinfo.origin);
+
+	VectorCopy(entinfo.origin, origin);
+	origin[2] -= 20;	// player height... how much is it?
+
+	if(!areanum) return;
+	for (reachnum = AAS_NextAreaReachability(areanum, 0); reachnum;
+		reachnum = AAS_NextAreaReachability(areanum, reachnum)){
+		
+		AAS_ReachabilityFromNum(reachnum, &reach);
+		
+		//AAS_DrawArrow(entinfo.origin, reach.start, LINECOLOR_BLUE, LINECOLOR_YELLOW);
+		AAS_DebugLine(origin, reach.start, LINECOLOR_YELLOW);
+		AAS_ShowReachability(&reach);
+		AAS_ShowArea(reach.areanum, qtrue);
+
+		//botimport.Print(PRT_MESSAGE, " towards area %d \n", reach.areanum);
+	}
+}
+
+void ShowReachesTo(void){
+	int areanum;
+	aas_reachability_t* reach;
+//	vec3_t origin;
+	aas_entityinfo_t entinfo;
+	int linknum;
+	aas_reversedreachability_t *revreach;
+    aas_reversedlink_t *revlink;
+
+	// client0 position
+	AAS_EntityInfo(0, &entinfo);
+	areanum = AAS_PointAreaNum(entinfo.origin);
+
+	if(!areanum) return;
+	// iterate over all 
+	revreach = &aasworld.reversedreachability[areanum];
+        //
+        for (revlink = revreach->first; revlink; revlink = revlink->next){
+        	linknum = revlink->linknum;
+            reach = &aasworld.reachability[linknum];
+
+			//AAS_DrawArrow(entinfo.origin, reach->end, LINECOLOR_BLUE, LINECOLOR_YELLOW);
+			AAS_DebugLine(entinfo.origin, reach->end, LINECOLOR_BLUE);
+			AAS_ShowReachability(reach);
+			AAS_ShowArea(revlink->areanum, qtrue);
+
+			//botimport.Print(PRT_MESSAGE, " from area %d \n", revlink->areanum);
+        }
+}
+
 //===========================================================================
 // called at the start of every frame
 //
@@ -333,47 +333,47 @@
 		AAS_WriteRouteCache();
 		LibVarSet("saveroutingcache", "0");
 	} //end if
-// cyr{
-	if ( LibVarGetValue("shownextitem") ){
-		/*
-		GetNextItemNumber(&showroute_ent, &showroute_entarea);
-		botimport.Print(PRT_MESSAGE, "avl %f next item: %d \n", LibVarGetValue("shownextitem"), showroute_ent);
-		PrintCurItemInfo();
-		ShowRoute(0, showroute_ent, showroute_entarea, qtrue);
-		*/
-		LibVarSet("shownextitem", "0");
-	}
-	if ( LibVarGetValue("shownoitem") ){
-		/*
-		showroute_ent = 0;
-		botimport.Print(PRT_MESSAGE, " %f dont show item route \n", LibVarGetValue("shownoitem") );
-		AAS_ClearShownPolygons();
-		AAS_ClearShownDebugLines();
-		*/
-		LibVarSet("shownoitem", "0");
-	}
-
-
-	if(showroute_ent != 0){
-		AAS_ClearShownPolygons();
-		AAS_ClearShownDebugLines();
-		ShowRoute(0, showroute_ent, showroute_entarea, qfalse);
-	}
-
-	if ( LibVarGetValue("showreachesfrom") ){
-		//botimport.Print(PRT_MESSAGE, " from \n");
-		AAS_ClearShownPolygons();
-		AAS_ClearShownDebugLines();
-		ShowReachesFrom();
-	}
-
-	if ( LibVarGetValue("showreachesto") ){
-		AAS_ClearShownPolygons();
-		AAS_ClearShownDebugLines();
-		ShowReachesTo();
-	}
-
-// cyr}
+// cyr{
+	if ( LibVarGetValue("shownextitem") ){
+		/*
+		GetNextItemNumber(&showroute_ent, &showroute_entarea);
+		botimport.Print(PRT_MESSAGE, "avl %f next item: %d \n", LibVarGetValue("shownextitem"), showroute_ent);
+		PrintCurItemInfo();
+		ShowRoute(0, showroute_ent, showroute_entarea, qtrue);
+		*/
+		LibVarSet("shownextitem", "0");
+	}
+	if ( LibVarGetValue("shownoitem") ){
+		/*
+		showroute_ent = 0;
+		botimport.Print(PRT_MESSAGE, " %f dont show item route \n", LibVarGetValue("shownoitem") );
+		AAS_ClearShownPolygons();
+		AAS_ClearShownDebugLines();
+		*/
+		LibVarSet("shownoitem", "0");
+	}
+
+
+	if(showroute_ent != 0){
+		AAS_ClearShownPolygons();
+		AAS_ClearShownDebugLines();
+		ShowRoute(0, showroute_ent, showroute_entarea, qfalse);
+	}
+
+	if ( LibVarGetValue("showreachesfrom") ){
+		//botimport.Print(PRT_MESSAGE, " from \n");
+		AAS_ClearShownPolygons();
+		AAS_ClearShownDebugLines();
+		ShowReachesFrom();
+	}
+
+	if ( LibVarGetValue("showreachesto") ){
+		AAS_ClearShownPolygons();
+		AAS_ClearShownDebugLines();
+		ShowReachesTo();
+	}
+
+// cyr}
 	//
 	aasworld.numframes++;
 	return BLERR_NOERROR;
Index: code/botlib/be_ai_move.c
===================================================================
--- code/botlib/be_ai_move.c	(revision 15)
+++ code/botlib/be_ai_move.c	(working copy)
@@ -3017,7 +3017,7 @@
 	//vec3_t mins, maxs, up = {0, 0, 1};
 	//bsp_trace_t trace;
 	//static int debugline;
-//	aas_entityinfo_t entinfo;
+//	aas_entityinfo_t entinfo;
 
 	result->failure = qfalse;
 	result->type = 0;
@@ -3468,65 +3468,65 @@
 	VectorCopy(ms->origin, ms->lastorigin);
 	//return the movement result
 	return;
-} //end of the function BotMoveToGoal
-
-// cyr {
-void ShowRoute(int client, int goalent, int goalentarea, int report){	// origin of goal
-	vec3_t curorigin, origin;
-	int i, area, curarea;
-	bot_goal_t goal;
-	aas_entityinfo_t entinfo, goalinfo;
-	// hm
-	static int avoidreach[MAX_AVOIDREACH];
-	static float avoidreachtimes[MAX_AVOIDREACH];
-	static int avoidreachtries[MAX_AVOIDREACH];
-	int reachnum, resultFlags;
-	aas_reachability_t reach;
-
-	// get goal origin
-	AAS_EntityInfo(goalent, &goalinfo);
-	VectorCopy( goalinfo.origin, origin);
-	
-	// goal
-	goal.areanum = goalentarea; //AAS_PointAreaNum(origin); //botlibglobals.goalareanum;
-	VectorCopy( origin, goal.origin);
-	// bot pos
-	AAS_EntityInfo(client, &entinfo);
-	area = AAS_PointAreaNum(entinfo.origin);
-	VectorCopy(entinfo.origin, curorigin);
-	curarea = area;
-
-
-/*	// draw straight arrow		
-	curorigin[2]-=25;
-	AAS_DrawArrow(curorigin, goal.origin, LINECOLOR_BLUE, LINECOLOR_YELLOW);
-	curorigin[2]+=25;*/
-
-	//if(report) botimport.Print(PRT_MESSAGE, "from %d to %d \n", area, goal.areanum);
-
-	// move towards goal
-	for ( i = 0; i < 100; i++ ) {
-		if ( curarea == goal.areanum ) {
-			break;
-		}
-		reachnum = BotGetReachabilityToGoal(curorigin, curarea,
-										  0, 0,
-										  avoidreach, avoidreachtimes, avoidreachtries,
-										  &goal, TFL_DEFAULT|TFL_FUNCBOB, TFL_DEFAULT|TFL_FUNCBOB,
-										  NULL, 0, &resultFlags);
-		
-		AAS_ReachabilityFromNum(reachnum, &reach);
-		
-		AAS_DrawArrow(curorigin, reach.start, LINECOLOR_BLUE, LINECOLOR_YELLOW);
-		AAS_ShowReachability(&reach);
-		
-		VectorCopy(reach.end, curorigin);	
-		//lastareanum = curarea;
-		curarea = reach.areanum;
-	}
-}
-// cyr }
+} //end of the function BotMoveToGoal
 
+// cyr {
+void ShowRoute(int client, int goalent, int goalentarea, int report){	// origin of goal
+	vec3_t curorigin, origin;
+	int i, area, curarea;
+	bot_goal_t goal;
+	aas_entityinfo_t entinfo, goalinfo;
+	// hm
+	static int avoidreach[MAX_AVOIDREACH];
+	static float avoidreachtimes[MAX_AVOIDREACH];
+	static int avoidreachtries[MAX_AVOIDREACH];
+	int reachnum, resultFlags;
+	aas_reachability_t reach;
+
+	// get goal origin
+	AAS_EntityInfo(goalent, &goalinfo);
+	VectorCopy( goalinfo.origin, origin);
+	
+	// goal
+	goal.areanum = goalentarea; //AAS_PointAreaNum(origin); //botlibglobals.goalareanum;
+	VectorCopy( origin, goal.origin);
+	// bot pos
+	AAS_EntityInfo(client, &entinfo);
+	area = AAS_PointAreaNum(entinfo.origin);
+	VectorCopy(entinfo.origin, curorigin);
+	curarea = area;
+
+
+/*	// draw straight arrow		
+	curorigin[2]-=25;
+	AAS_DrawArrow(curorigin, goal.origin, LINECOLOR_BLUE, LINECOLOR_YELLOW);
+	curorigin[2]+=25;*/
+
+	//if(report) botimport.Print(PRT_MESSAGE, "from %d to %d \n", area, goal.areanum);
+
+	// move towards goal
+	for ( i = 0; i < 100; i++ ) {
+		if ( curarea == goal.areanum ) {
+			break;
+		}
+		reachnum = BotGetReachabilityToGoal(curorigin, curarea,
+										  0, 0,
+										  avoidreach, avoidreachtimes, avoidreachtries,
+										  &goal, TFL_DEFAULT|TFL_FUNCBOB, TFL_DEFAULT|TFL_FUNCBOB,
+										  NULL, 0, &resultFlags);
+		
+		AAS_ReachabilityFromNum(reachnum, &reach);
+		
+		AAS_DrawArrow(curorigin, reach.start, LINECOLOR_BLUE, LINECOLOR_YELLOW);
+		AAS_ShowReachability(&reach);
+		
+		VectorCopy(reach.end, curorigin);	
+		//lastareanum = curarea;
+		curarea = reach.areanum;
+	}
+}
+// cyr }
+
 //===========================================================================
 //
 // Parameter:				-
Index: code/botlib/be_aas_def.h
===================================================================
--- code/botlib/be_aas_def.h	(revision 15)
+++ code/botlib/be_aas_def.h	(working copy)
@@ -168,22 +168,22 @@
 	qboolean inlist;							//true if the update is in the list
 	struct aas_routingupdate_s *next;
 	struct aas_routingupdate_s *prev;
-	// cyr
-    struct aas_routingupdate_s* fib_parent;  // zeiger auf vater
-    struct aas_routingupdate_s* fib_child;
-    struct aas_routingupdate_s* fib_left;
-    struct aas_routingupdate_s* fib_right;
-    int                     fib_degree;   // anzahl der söhne
-    int                     fib_mark;     // hm
+	// cyr
+    struct aas_routingupdate_s* fib_parent;  // zeiger auf vater
+    struct aas_routingupdate_s* fib_child;
+    struct aas_routingupdate_s* fib_left;
+    struct aas_routingupdate_s* fib_right;
+    int                     fib_degree;   // anzahl der söhne
+    int                     fib_mark;     // hm
 } aas_routingupdate_t;
-
-// cyr  fibonacci heap
-typedef struct MyQueue_s{
-    aas_routingupdate_t* proot; // first element ( heap could be implemented without this)
-    aas_routingupdate_t* pmin;  // minimum element
-    int size;                   // nodes count
-}MyQueue_t;
 
+// cyr  fibonacci heap
+typedef struct MyQueue_s{
+    aas_routingupdate_t* proot; // first element ( heap could be implemented without this)
+    aas_routingupdate_t* pmin;  // minimum element
+    int size;                   // nodes count
+}MyQueue_t;
+
 //reversed reachability link
 typedef struct aas_reversedlink_s
 {
@@ -293,7 +293,7 @@
 	//cache list sorted on time
 	aas_routingcache_t *oldestcache;		// start of cache list sorted on time
 	aas_routingcache_t *newestcache;		// end of cache list sorted on time
-	aas_routingupdate_t** fibA;     // cyr
+	aas_routingupdate_t** fibA;     // cyr
 	//maximum travel time through portal areas
 	int *portalmaxtraveltimes;
 	//areas the reachabilities go through
Index: code/client/snd_dma.c
===================================================================
--- code/client/snd_dma.c	(revision 15)
+++ code/client/snd_dma.c	(working copy)
@@ -109,7 +109,7 @@
 		Com_Printf("%5d samplebits\n", dma.samplebits);
 		Com_Printf("%5d submission_chunk\n", dma.submission_chunk);
 		Com_Printf("%5d speed\n", dma.speed);
-		Com_Printf("0x%x dma buffer\n", dma.buffer);
+		Com_Printf("%p dma buffer\n", dma.buffer);
 		if ( s_backgroundStream ) {
 			Com_Printf("Background file: %s\n", s_backgroundLoop );
 		} else {
@@ -466,7 +466,7 @@
 	}
 
 	if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
-		Com_Printf( S_COLOR_YELLOW, "S_StartSound: handle %i out of range\n", sfxHandle );
+		Com_Printf( S_COLOR_YELLOW "S_StartSound: handle %i out of range\n", sfxHandle );
 		return;
 	}
 
@@ -578,7 +578,7 @@
 	}
 
 	if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
-		Com_Printf( S_COLOR_YELLOW, "S_StartLocalSound: handle %i out of range\n", sfxHandle );
+		Com_Printf( S_COLOR_YELLOW "S_StartLocalSound: handle %i out of range\n", sfxHandle );
 		return;
 	}
 
@@ -687,7 +687,7 @@
 	}
 
 	if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
-		Com_Printf( S_COLOR_YELLOW, "S_AddLoopingSound: handle %i out of range\n", sfxHandle );
+		Com_Printf( S_COLOR_YELLOW "S_AddLoopingSound: handle %i out of range\n", sfxHandle );
 		return;
 	}
 
@@ -750,7 +750,7 @@
 	}
 
 	if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
-		Com_Printf( S_COLOR_YELLOW, "S_AddRealLoopingSound: handle %i out of range\n", sfxHandle );
+		Com_Printf( S_COLOR_YELLOW "S_AddRealLoopingSound: handle %i out of range\n", sfxHandle );
 		return;
 	}
 
@@ -1115,7 +1115,7 @@
 		ch = s_channels;
 		for (i=0 ; i<MAX_CHANNELS; i++, ch++) {
 			if (ch->thesfx && (ch->leftvol || ch->rightvol) ) {
-				Com_Printf ("%f %f %s\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName);
+				Com_Printf ("%d %d %s\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName);
 				total++;
 			}
 		}
Index: code/client/qal.c
===================================================================
--- code/client/qal.c	(revision 15)
+++ code/client/qal.c	(working copy)
@@ -153,7 +153,7 @@
 	}
 	else
 	{
-		Com_DPrintf( " Loaded symbol %s (0x%08X)\n", str, rv);
+		Com_DPrintf( " Loaded symbol %s (%p)\n", str, rv);
         return rv;
 	}
 }
Index: code/client/cl_cgame.c
===================================================================
--- code/client/cl_cgame.c	(revision 15)
+++ code/client/cl_cgame.c	(working copy)
@@ -698,7 +698,7 @@
 
 	default:
 	        assert(0); // bk010102
-		Com_Error( ERR_DROP, "Bad cgame system trap: %i", args[0] );
+		Com_Error( ERR_DROP, "Bad cgame system trap: %ld", (long int) args[0] );
 	}
 	return 0;
 }
Index: code/client/cl_ui.c
===================================================================
--- code/client/cl_ui.c	(revision 15)
+++ code/client/cl_ui.c	(working copy)
@@ -1109,7 +1109,7 @@
 
 		
 	default:
-		Com_Error( ERR_DROP, "Bad UI system trap: %i", args[0] );
+		Com_Error( ERR_DROP, "Bad UI system trap: %ld", (long int) args[0] );
 
 	}
 
Index: Makefile
===================================================================
--- Makefile	(revision 15)
+++ Makefile	(working copy)
@@ -256,7 +256,8 @@
 
   THREAD_LDFLAGS=-lpthread
   LDFLAGS=-ldl -lm
-
+  LDFLAGS += -L/emul/linux/x86/usr/lib
+  
   ifeq ($(USE_SDL),1)
     CLIENT_LDFLAGS=$(shell sdl-config --libs)
   else
