Code style, people. Love it or leave it!

This commit is contained in:
Ragnvald Maartmann-Moe IV 2003-03-21 21:25:44 +00:00
parent 16eac174e6
commit 5fb8aa07f3
26 changed files with 400 additions and 414 deletions

View file

@ -188,7 +188,7 @@ Cam_Lock (int playernum)
snprintf (st, sizeof (st), "ptrack %i", playernum); snprintf (st, sizeof (st), "ptrack %i", playernum);
if (cls.demoplayback2) { if (cls.demoplayback2) {
memcpy(cl.stats, cl.players[playernum].stats, sizeof (cl.stats)); memcpy (cl.stats, cl.players[playernum].stats, sizeof (cl.stats));
} }
if (!cls.demoplayback) { if (!cls.demoplayback) {
@ -350,7 +350,7 @@ InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
} }
// ack, can't find him // ack, can't find him
if (max >= 1000) { if (max >= 1000) {
// Cam_Unlock(); // Cam_Unlock ();
return false; return false;
} }
locked = true; locked = true;
@ -623,7 +623,7 @@ Cam_FinishMove (usercmd_t *cmd)
} }
oldbuttons |= BUTTON_JUMP; // don't jump again until released oldbuttons |= BUTTON_JUMP; // don't jump again until released
} }
// Con_Printf("Selecting track target...\n"); // Con_Printf ("Selecting track target...\n");
if (locked && autocam) if (locked && autocam)
end = (spec_track + 1) % MAX_CLIENTS; end = (spec_track + 1) % MAX_CLIENTS;

View file

@ -406,8 +406,8 @@ CL_GetMessage (void)
return false; return false;
if (net_packetlog->int_val) if (net_packetlog->int_val)
Log_Incoming_Packet(net_message->message->data, Log_Incoming_Packet (net_message->message->data,
net_message->message->cursize, 1); net_message->message->cursize, 1);
CL_WriteDemoMessage (net_message->message); CL_WriteDemoMessage (net_message->message);
@ -965,7 +965,7 @@ CL_FinishTimeDemo (void)
Con_Printf ("%i frames %5.2f seconds %5.2f fps\n", frames, time, Con_Printf ("%i frames %5.2f seconds %5.2f fps\n", frames, time,
frames / time); frames / time);
CL_TimeFrames_DumpLog(); CL_TimeFrames_DumpLog ();
cl_timeframes_isactive = 0; cl_timeframes_isactive = 0;
timedemo_count--; timedemo_count--;
@ -1050,7 +1050,7 @@ void
CL_TimeFrames_Reset (void) CL_TimeFrames_Reset (void)
{ {
cl_timeframes_index = 0; cl_timeframes_index = 0;
free(cl_timeframes_array); free (cl_timeframes_array);
cl_timeframes_array = NULL; cl_timeframes_array = NULL;
} }
@ -1060,7 +1060,7 @@ CL_TimeFrames_AddTimestamp (void)
if (cl_timeframes_isactive) { if (cl_timeframes_isactive) {
if (!(cl_timeframes_index % CL_TIMEFRAMES_ARRAYBLOCK)) if (!(cl_timeframes_index % CL_TIMEFRAMES_ARRAYBLOCK))
cl_timeframes_array = realloc cl_timeframes_array = realloc
(cl_timeframes_array, sizeof(cl_timeframes_array[0]) * (cl_timeframes_array, sizeof (cl_timeframes_array[0]) *
((cl_timeframes_index / CL_TIMEFRAMES_ARRAYBLOCK) + 1) * ((cl_timeframes_index / CL_TIMEFRAMES_ARRAYBLOCK) + 1) *
CL_TIMEFRAMES_ARRAYBLOCK); CL_TIMEFRAMES_ARRAYBLOCK);
if (cl_timeframes_array == NULL) if (cl_timeframes_array == NULL)

View file

@ -519,7 +519,7 @@ CL_LinkPacketEntities (void)
(*ent)->angles[1] = anglemod (100 * cl.time); (*ent)->angles[1] = anglemod (100 * cl.time);
(*ent)->angles[2] = 0; (*ent)->angles[2] = 0;
} else { } else {
VectorCopy(s1->angles, (*ent)->angles); VectorCopy (s1->angles, (*ent)->angles);
} }
// add automatic particle trails // add automatic particle trails
@ -682,10 +682,10 @@ CL_ParsePlayerinfo (void)
cls.findtrack = false; cls.findtrack = false;
} }
memcpy(state, prevstate, sizeof(player_state_t)); memcpy (state, prevstate, sizeof (player_state_t));
flags = MSG_ReadShort (net_message); flags = MSG_ReadShort (net_message);
state->flags = TranslateFlags(flags); state->flags = TranslateFlags (flags);
state->messagenum = cl.parsecount; state->messagenum = cl.parsecount;
state->command.msec = 0; state->command.msec = 0;
state->frame = MSG_ReadByte (net_message); state->frame = MSG_ReadByte (net_message);
@ -1076,7 +1076,7 @@ CL_SetUpPlayerPrediction (qboolean dopred)
CL_SetSolid CL_SetSolid
Builds all the pmove physents for the current frame Builds all the pmove physents for the current frame
Note that CL_SetUpPlayerPrediction() must be called first! Note that CL_SetUpPlayerPrediction () must be called first!
pmove must be setup with world and solid entity hulls before calling pmove must be setup with world and solid entity hulls before calling
(via CL_PredictMove) (via CL_PredictMove)
*/ */

View file

@ -580,7 +580,7 @@ CL_FullServerinfo_f (void)
return; return;
} }
Con_DPrintf ("Cmd_Argv(1): '%s'\n", Cmd_Argv (1)); Con_DPrintf ("Cmd_Argv (1): '%s'\n", Cmd_Argv (1));
Info_Destroy (cl.serverinfo); Info_Destroy (cl.serverinfo);
cl.serverinfo = Info_ParseString (Cmd_Argv (1), MAX_SERVERINFO_STRING, 0); cl.serverinfo = Info_ParseString (Cmd_Argv (1), MAX_SERVERINFO_STRING, 0);
Con_DPrintf ("cl.serverinfo: '%s'\n", Info_MakeString (cl.serverinfo, 0)); Con_DPrintf ("cl.serverinfo: '%s'\n", Info_MakeString (cl.serverinfo, 0));
@ -936,9 +936,9 @@ CL_ConnectionlessPacket (void)
// print command from somewhere // print command from somewhere
if (c == A2C_PRINT) { if (c == A2C_PRINT) {
s = MSG_ReadString (net_message); s = MSG_ReadString (net_message);
if (SL_CheckStatus(NET_AdrToString (net_from), s)) if (SL_CheckStatus (NET_AdrToString (net_from), s))
{ {
Con_Printf("status response\n"); Con_Printf ("status response\n");
return; return;
} else if (!cls.demoplayback } else if (!cls.demoplayback
&& (cl_paranoid->int_val && (cl_paranoid->int_val
@ -987,10 +987,10 @@ CL_ConnectionlessPacket (void)
if (c == M2C_MASTER_REPLY) if (c == M2C_MASTER_REPLY)
{ {
Con_Printf("Master Server Reply\n"); Con_Printf ("Master Server Reply\n");
clcp_temp = MSG_ReadByte (net_message); clcp_temp = MSG_ReadByte (net_message);
s = MSG_ReadString (net_message); s = MSG_ReadString (net_message);
MSL_ParseServerList(s); MSL_ParseServerList (s);
return; return;
} }
if (c == svc_disconnect) { if (c == svc_disconnect) {
@ -1013,8 +1013,8 @@ CL_ReadPackets (void)
continue; continue;
if (cls.demoplayback && net_packetlog->int_val) if (cls.demoplayback && net_packetlog->int_val)
Log_Incoming_Packet(net_message->message->data, Log_Incoming_Packet (net_message->message->data,
net_message->message->cursize, 0); net_message->message->cursize, 0);
// remote command packet // remote command packet
if (*(int *) net_message->message->data == -1) { if (*(int *) net_message->message->data == -1) {
@ -1752,7 +1752,7 @@ Host_Init (void)
Key_Init (cl_cbuf); Key_Init (cl_cbuf);
Mod_Init (); Mod_Init ();
CL_Demo_Init(); CL_Demo_Init ();
Con_Printf ("%4.1f megabyte heap.\n", cl_mem_size->value); Con_Printf ("%4.1f megabyte heap.\n", cl_mem_size->value);

View file

@ -488,7 +488,7 @@ CL_ParseDownload (void)
} }
// open the file if not opened yet // open the file if not opened yet
if (!cls.download) { if (!cls.download) {
dstring_t *name = dstring_newstr(); dstring_t *name = dstring_newstr ();
const char *fname, *path; const char *fname, *path;
if (strncmp (cls.downloadtempname, "skins/", 6) == 0) { if (strncmp (cls.downloadtempname, "skins/", 6) == 0) {
@ -769,7 +769,7 @@ CL_ParseSoundlist (void)
int numsounds, n; int numsounds, n;
// precache sounds // precache sounds
// memset (cl.sound_precache, 0, sizeof(cl.sound_precache)); // memset (cl.sound_precache, 0, sizeof (cl.sound_precache));
numsounds = MSG_ReadByte (net_message); numsounds = MSG_ReadByte (net_message);
@ -1123,7 +1123,7 @@ CL_SetStat (int stat, int value)
break; break;
case STAT_HEALTH: case STAT_HEALTH:
if (cl_player_health_e->func) if (cl_player_health_e->func)
GIB_Event_Callback (cl_player_health_e, 1, va("%i", value)); GIB_Event_Callback (cl_player_health_e, 1, va ("%i", value));
if (value <= 0) if (value <= 0)
Team_Dead (); Team_Dead ();
break; break;
@ -1164,7 +1164,9 @@ CL_MuzzleFlash (void)
dl->color[2] = 0.05; dl->color[2] = 0.05;
} }
#define SHOWNET(x) if (cl_shownet->int_val == 2) Con_Printf ("%3i:%s\n", net_message->readcount-1, x); #define SHOWNET(x) \
if (cl_shownet->int_val == 2) \
Con_Printf ("%3i:%s\n", net_message->readcount-1, x);
int received_framecount; int received_framecount;
@ -1247,7 +1249,7 @@ CL_ParseServerMessage (void)
S_LocalSound ("misc/talk.wav"); S_LocalSound ("misc/talk.wav");
if (cl_chat_e->func) if (cl_chat_e->func)
GIB_Event_Callback (cl_chat_e, 1, s); GIB_Event_Callback (cl_chat_e, 1, s);
Team_ParseChat(s); Team_ParseChat (s);
} }
Con_Printf ("%s", s); Con_Printf ("%s", s);
Con_SetOrMask (0); Con_SetOrMask (0);
@ -1271,7 +1273,7 @@ CL_ParseServerMessage (void)
} else { } else {
Con_DPrintf ("partial stufftext: %s\n", s); Con_DPrintf ("partial stufftext: %s\n", s);
if (!stuffbuf) if (!stuffbuf)
stuffbuf = dstring_newstr(); stuffbuf = dstring_newstr ();
dstring_appendstr (stuffbuf, s); dstring_appendstr (stuffbuf, s);
} }
break; break;
@ -1422,7 +1424,7 @@ CL_ParseServerMessage (void)
break; break;
case svc_finale: case svc_finale:
Con_Printf("svc_finale\n"); Con_Printf ("svc_finale\n");
cl.intermission = 2; cl.intermission = 2;
cl.completed_time = realtime; cl.completed_time = realtime;
vid.recalc_refdef = true; // go to full screen vid.recalc_refdef = true; // go to full screen

View file

@ -184,8 +184,8 @@ CL_PredictMove (void)
if (to->senttime == from->senttime) if (to->senttime == from->senttime)
f = 0; f = 0;
else else
f = bound(0, (cl.time - from->senttime) / f = bound (0, (cl.time - from->senttime) /
(to->senttime - from->senttime), 1); (to->senttime - from->senttime), 1);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
if (fabs (from->playerstate[cl.playernum].origin[i] - if (fabs (from->playerstate[cl.playernum].origin[i] -

View file

@ -238,13 +238,13 @@ CL_NewTranslation (int slot, skin_t *skin)
Skin_Find (player); Skin_Find (player);
memcpy (skin, player->skin, sizeof (*skin)); memcpy (skin, player->skin, sizeof (*skin));
skin->texture = skin_textures + slot; // FIXME skin->texture = skin_textures + slot; // FIXME
skin->data.texels = Skin_Cache(player->skin); skin->data.texels = Skin_Cache (player->skin);
// FIXME: breaks cache ownership // FIXME: breaks cache ownership
Skin_Do_Translation (player->skin, slot, skin); Skin_Do_Translation (player->skin, slot, skin);
} else { } else {
memcpy (skin, player->skin, sizeof (*skin)); memcpy (skin, player->skin, sizeof (*skin));
skin->texture = skin_textures + slot; // FIXME skin->texture = skin_textures + slot; // FIXME
skin->data.texels = Skin_Cache(player->skin); skin->data.texels = Skin_Cache (player->skin);
// FIXME: breaks cache ownership // FIXME: breaks cache ownership
} }
} }

View file

@ -139,7 +139,7 @@ SL_Add (server_entry_t *start, const char *ip, const char *desc)
} }
for (p = start; p->next; p = p->next) //Get to end of list for (p = start; p->next; p = p->next) //Get to end of list
if (strcmp(ip,p->server) == 0) //don't add duplicate if (strcmp (ip, p->server) == 0) //don't add duplicate
return (start); return (start);
p->next = calloc (1, sizeof (server_entry_t)); p->next = calloc (1, sizeof (server_entry_t));
@ -230,23 +230,21 @@ static int
SL_CheckFilter (server_entry_t *sl_filteritem) SL_CheckFilter (server_entry_t *sl_filteritem)
{ {
if (!sl_filter->int_val) if (!sl_filter->int_val)
return(1); return (1);
if (!sl_filteritem->status) if (!sl_filteritem->status)
return(0); return (0);
if (strlen(sl_game->string)) if (strlen (sl_game->string)) {
{ if (strcasecmp (Info_ValueForKey (sl_filteritem->status, "*gamedir"),
if (strcasecmp(Info_ValueForKey (sl_filteritem->status, "*gamedir"), sl_game->string) != 0)
sl_game->string) != 0) return (0);
return(0);
} }
if (sl_ping->int_val) if (sl_ping->int_val) {
{
if (!sl_filteritem->pongback) if (!sl_filteritem->pongback)
return(0); return (0);
if (((int)(sl_filteritem->pongback * 1000)) >= sl_ping->int_val) if (((int) (sl_filteritem->pongback * 1000)) >= sl_ping->int_val)
return(0); return (0);
} }
return(1); return (1);
} }
static server_entry_t * static server_entry_t *
@ -256,7 +254,7 @@ SL_Get_By_Num (server_entry_t *start, int n)
for (i = 0; i <= n; i++) for (i = 0; i <= n; i++)
{ {
if(!start) if (!start)
break; break;
if (!SL_CheckFilter (start)) if (!SL_CheckFilter (start))
i--; i--;
@ -380,25 +378,21 @@ SL_SortEntry (server_entry_t *start)
if (!start || !sl_sortby) if (!start || !sl_sortby)
return; return;
for (q = start->next; q; q = q->next) for (q = start->next; q; q = q->next) {
{ if (sl_sortby->int_val) {
if (sl_sortby->int_val)
{
if ((q->pongback) && (start->pongback) && (start->pongback > if ((q->pongback) && (start->pongback) && (start->pongback >
q->pongback)) q->pongback)) {
{ SL_Swap (start, q);
SL_Swap(start,q);
q = start; q = start;
} }
} else { } else {
i = 0; i = 0;
while ((start->desc[i] != '\0') && (q->desc[i] != '\0') && while ((start->desc[i] != '\0') && (q->desc[i] != '\0') &&
(toupper(start->desc[i]) == toupper(q->desc[i]))) (toupper (start->desc[i]) == toupper (q->desc[i])))
i++; i++;
if (toupper(start->desc[i]) > toupper(q->desc[i])) if (toupper (start->desc[i]) > toupper (q->desc[i])) {
{ SL_Swap (start, q);
SL_Swap(start,q);
q = start; q = start;
} }
} }
@ -422,15 +416,14 @@ SL_Con_List (server_entry_t *sldata)
{ {
int serv; int serv;
server_entry_t *cp; server_entry_t *cp;
SL_Sort(sl_sortby); SL_Sort (sl_sortby);
for(serv = 0; serv < SL_Len (sldata); serv++) for (serv = 0; serv < SL_Len (sldata); serv++) {
{
cp = SL_Get_By_Num (sldata, serv); cp = SL_Get_By_Num (sldata, serv);
if (!cp) if (!cp)
break; break;
Con_Printf("%i) %s\n",(serv + 1),cp->desc); Con_Printf ("%i) %s\n", (serv + 1), cp->desc);
} }
} }
@ -439,7 +432,7 @@ SL_Connect (server_entry_t *sldata, int slitemno)
{ {
CL_Disconnect (); CL_Disconnect ();
strncpy (cls.servername, SL_Get_By_Num (sldata, (slitemno - 1))->server, strncpy (cls.servername, SL_Get_By_Num (sldata, (slitemno - 1))->server,
sizeof (cls.servername) - 0); sizeof (cls.servername) - 0);
CL_BeginServerConnect (); CL_BeginServerConnect ();
} }
@ -470,37 +463,36 @@ SL_Con_Details (server_entry_t *sldata, int slitemno)
cp = SL_Get_By_Num (sldata, (slitemno - 1)); cp = SL_Get_By_Num (sldata, (slitemno - 1));
if (!cp) if (!cp)
return; return;
Con_Printf("Server: %s\n", cp->server); Con_Printf ("Server: %s\n", cp->server);
Con_Printf("Ping: "); Con_Printf ("Ping: ");
if (cp->pongback) if (cp->pongback)
Con_Printf("%i\n", (int)(cp->pongback * 1000)); Con_Printf ("%i\n", (int) (cp->pongback * 1000));
else else
Con_Printf("N/A\n"); Con_Printf ("N/A\n");
if (cp->status) if (cp->status) {
{
char *s; char *s;
Con_Printf("Name: %s\n", cp->desc); Con_Printf ("Name: %s\n", cp->desc);
Con_Printf("Game: %s\n", Info_ValueForKey (cp->status, "*gamedir")); Con_Printf ("Game: %s\n", Info_ValueForKey (cp->status, "*gamedir"));
Con_Printf("Map: %s\n", Info_ValueForKey (cp->status, "map")); Con_Printf ("Map: %s\n", Info_ValueForKey (cp->status, "map"));
s = Info_MakeString (cp->status, 0); s = Info_MakeString (cp->status, 0);
for (i = 0; i < strlen (s); i++) for (i = 0; i < strlen (s); i++)
if (s[i] == '\n') if (s[i] == '\n')
playercount++; playercount++;
Con_Printf("Players: %i/%s\n", playercount, Con_Printf ("Players: %i/%s\n", playercount,
Info_ValueForKey(cp->status, "maxclients")); Info_ValueForKey (cp->status, "maxclients"));
} else } else
Con_Printf("No Details Available\n"); Con_Printf ("No Details Available\n");
} }
static void static void
SL_MasterUpdate(void) SL_MasterUpdate (void)
{ {
char data[] = "c\n\0"; char data[] = "c\n\0";
netadr_t addy; netadr_t addy;
SL_Del_All(slist); SL_Del_All (slist);
slist = NULL; slist = NULL;
NET_StringToAdr ("194.251.249.32:27000", &addy); NET_StringToAdr ("194.251.249.32:27000", &addy);
Netchan_SendPacket (3, data, addy); Netchan_SendPacket (3, data, addy);
@ -523,8 +515,7 @@ SL_MasterUpdate(void)
static int static int
SL_Switch (void) SL_Switch (void)
{ {
if (!which_slist) if (!which_slist) {
{
fav_slist = slist; fav_slist = slist;
slist = all_slist; slist = all_slist;
which_slist = 1; which_slist = 1;
@ -543,77 +534,65 @@ SL_Command (void)
int sltemp = 0; int sltemp = 0;
if (Cmd_Argc () == 1) if (Cmd_Argc () == 1)
SL_Con_List(slist); SL_Con_List (slist);
else if (strcasecmp(Cmd_Argv(1),"switch") == 0) else if (strcasecmp (Cmd_Argv (1), "switch") == 0) {
{
if (SL_Switch ()) if (SL_Switch ())
Con_Printf("Switched to Server List from Masters\n"); Con_Printf ("Switched to Server List from Masters\n");
else else
Con_Printf("Switched to Favorite Server List\n"); Con_Printf ("Switched to Favorite Server List\n");
} } else if (strcasecmp (Cmd_Argv (1), "refresh") == 0) {
else if (strcasecmp(Cmd_Argv(1),"refresh") == 0)
{
if (Cmd_Argc () == 2) if (Cmd_Argc () == 2)
SL_Update(slist); SL_Update (slist);
else else
Con_Printf("Syntax: slist refresh\n"); Con_Printf ("Syntax: slist refresh\n");
} } else if (strcasecmp (Cmd_Argv (1),"update") == 0) {
else if (strcasecmp(Cmd_Argv(1),"update") == 0) if (Cmd_Argc () == 2) {
{ if (!which_slist)
if (Cmd_Argc () == 2) Con_Printf ("ERROR: This of for updating the servers from a "
{ "list of masters\n");
if(!which_slist)
Con_Printf("ERROR: This of for updating the servers from a "
"list of masters\n");
else else
SL_MasterUpdate(); SL_MasterUpdate ();
} } else
else Con_Printf ("Syntax: slist update\n");
Con_Printf("Syntax: slist update\n"); } else if (strcasecmp (Cmd_Argv (1), "connect") == 0) {
} if (Cmd_Argc () == 3) {
else if (strcasecmp(Cmd_Argv(1),"connect") == 0) sltemp = atoi (Cmd_Argv (2));
{ if (sltemp && (sltemp <= SL_Len (slist)))
if (Cmd_Argc () == 3) SL_Connect (slist, sltemp);
{
sltemp = atoi(Cmd_Argv(2));
if(sltemp && (sltemp <= SL_Len (slist)))
SL_Connect(slist,sltemp);
else else
Con_Printf("Error: Invalid Server Number -> %s\n",Cmd_Argv(2)); Con_Printf ("Error: Invalid Server Number -> %s\n",
} Cmd_Argv (2));
else if ((Cmd_Argc () == 2) && slist_last_details) } else if ((Cmd_Argc () == 2) && slist_last_details)
SL_Connect(slist,slist_last_details); SL_Connect (slist, slist_last_details);
else else
Con_Printf("Syntax: slist connect #\n"); Con_Printf ("Syntax: slist connect #\n");
} } else {
else sltemp = atoi (Cmd_Argv (1));
{ if ((Cmd_Argc () == 2) && sltemp && (sltemp <= SL_Len (slist)))
sltemp = atoi(Cmd_Argv(1)); SL_Con_Details (slist, sltemp);
if((Cmd_Argc () == 2) && sltemp && (sltemp <= SL_Len (slist)))
SL_Con_Details(slist,sltemp);
} }
} }
void void
MSL_ParseServerList(const char *msl_data) MSL_ParseServerList (const char *msl_data)
{ {
int msl_ptr; int msl_ptr;
for (msl_ptr = 0; msl_ptr < strlen(msl_data); msl_ptr = msl_ptr + 6) for (msl_ptr = 0; msl_ptr < strlen (msl_data); msl_ptr = msl_ptr + 6) {
{ slist = SL_Add (slist, va ("%i.%i.%i.%i:%i",
slist = SL_Add(slist, va("%i.%i.%i.%i:%i", (byte) msl_data[msl_ptr],
(byte)msl_data[msl_ptr], (byte) msl_data[msl_ptr+1],
(byte)msl_data[msl_ptr+1], (byte) msl_data[msl_ptr+2],
(byte)msl_data[msl_ptr+2], (byte) msl_data[msl_ptr+3],
(byte)msl_data[msl_ptr+3], ((byte) msl_data[msl_ptr + 4] << 8)
((byte)msl_data[msl_ptr+4]<<8)|(byte)msl_data[msl_ptr+5]), NULL); | (byte) msl_data[msl_ptr + 5]), NULL);
} }
} }
static server_entry_t * static server_entry_t *
SL_LoadF (QFile *f, server_entry_t *start) SL_LoadF (QFile *f, server_entry_t *start)
{ {
//This could get messy // This could get messy
char line[256]; /* Long lines get truncated. */ char line[256]; /* Long lines get truncated. */
char *addr, *st; char *addr, *st;
int len, i; int len, i;
@ -669,8 +648,8 @@ SL_Init (void)
fav_slist = slist; fav_slist = slist;
all_slist = NULL; all_slist = NULL;
which_slist = 0; which_slist = 0;
Cmd_AddCommand("slist",SL_Command,"console commands to access server " Cmd_AddCommand ("slist", SL_Command, "console commands to access server "
"list\n"); "list\n");
sl_sortby = Cvar_Get ("sl_sortby", "0", CVAR_ARCHIVE, SL_Sort, "0 = sort " sl_sortby = Cvar_Get ("sl_sortby", "0", CVAR_ARCHIVE, SL_Sort, "0 = sort "
"by name, 1 = sort by ping"); "by name, 1 = sort by ping");
sl_filter = Cvar_Get ("sl_filter", "0", CVAR_NONE, NULL, "enable server " sl_filter = Cvar_Get ("sl_filter", "0", CVAR_NONE, NULL, "enable server "
@ -688,14 +667,13 @@ SL_CheckStatus (const char *cs_from, const char *cs_data)
server_entry_t *temp; server_entry_t *temp;
for (temp = slist; temp; temp = temp->next) for (temp = slist; temp; temp = temp->next)
if (temp->waitstatus) if (temp->waitstatus) {
{ if (strcmp (cs_from, temp->server) == 0) {
if (strcmp (cs_from, temp->server) == 0)
{
int i; int i;
char *data = strdup (cs_data); char *data = strdup (cs_data);
strcpy (data, cs_data); strcpy (data, cs_data);
for (i = 0; i < strlen(data); i++) for (i = 0; i < strlen (data); i++)
if (data[i] == '\n') { if (data[i] == '\n') {
data[i] = '\\'; data[i] = '\\';
break; break;
@ -706,11 +684,11 @@ SL_CheckStatus (const char *cs_from, const char *cs_data)
temp->waitstatus = 0; temp->waitstatus = 0;
tmp_desc = Info_ValueForKey (temp->status, "hostname"); tmp_desc = Info_ValueForKey (temp->status, "hostname");
if (tmp_desc[0] != '\0') { if (tmp_desc[0] != '\0') {
temp->desc = realloc(temp->desc, strlen(tmp_desc) + 1); temp->desc = realloc (temp->desc, strlen (tmp_desc) + 1);
strcpy(temp->desc, tmp_desc); strcpy (temp->desc, tmp_desc);
} else { } else {
temp->desc = realloc(temp->desc, strlen(data) + 1); temp->desc = realloc (temp->desc, strlen (data) + 1);
strcpy(temp->desc, data); strcpy (temp->desc, data);
} }
free (data); free (data);
return (1); return (1);
@ -728,7 +706,7 @@ SL_CheckPing (const char *cp_from)
if (temp->pingsent && !temp->pongback) { if (temp->pingsent && !temp->pongback) {
if (strcmp (cp_from, temp->server)) { if (strcmp (cp_from, temp->server)) {
temp->pongback = Sys_DoubleTime (); temp->pongback = Sys_DoubleTime ();
timepassed(temp->pingsent, &temp->pongback); timepassed (temp->pingsent, &temp->pongback);
} }
} }
} }

View file

@ -281,7 +281,7 @@ CL_ParseBeam (model_t *m)
b->entity = ent; b->entity = ent;
b->model = m; b->model = m;
b->endtime = cl.time + 0.2; b->endtime = cl.time + 0.2;
b->seed = rand(); b->seed = rand ();
VectorCopy (end, b->end); VectorCopy (end, b->end);
if (b->entity != cl.viewentity) { if (b->entity != cl.viewentity) {
// this will be done in CL_UpdateBeams // this will be done in CL_UpdateBeams
@ -427,7 +427,7 @@ CL_ParseTEnt (void)
dl->radius = 350; dl->radius = 350;
dl->die = cl.time + 0.5; dl->die = cl.time + 0.5;
dl->decay = 300; dl->decay = 300;
colorStart = (colorStart + (rand() % colorLength)) * 3; colorStart = (colorStart + (rand () % colorLength)) * 3;
dl->color[0] = vid.palette[colorStart] * (1.0 / 255.0); dl->color[0] = vid.palette[colorStart] * (1.0 / 255.0);
dl->color[1] = vid.palette[colorStart + 1] * (1.0 / 255.0); dl->color[1] = vid.palette[colorStart + 1] * (1.0 / 255.0);
dl->color[2] = vid.palette[colorStart + 2] * (1.0 / 255.0); dl->color[2] = vid.palette[colorStart + 2] * (1.0 / 255.0);

View file

@ -470,7 +470,7 @@ V_PrepBlend (void)
if (!vid.cshift_changed && !vid.recalc_refdef) if (!vid.cshift_changed && !vid.recalc_refdef)
return; return;
V_CalcBlend(); V_CalcBlend ();
} }
/* VIEW RENDERING */ /* VIEW RENDERING */

View file

@ -152,7 +152,7 @@ CF_BuildQuota (void)
cf_cursize = 0; cf_cursize = 0;
while ((i = readdir(dir))) { while ((i = readdir (dir))) {
cf_cursize += CF_GetFileSize (va ("%s/%s", path->str, i->d_name)); cf_cursize += CF_GetFileSize (va ("%s/%s", path->str, i->d_name));
} }
closedir (dir); closedir (dir);
@ -166,7 +166,7 @@ CF_BuildQuota (void)
void void
CF_Init (void) CF_Init (void)
{ {
CF_BuildQuota(); CF_BuildQuota ();
crudefile_quota = Cvar_Get ("crudefile_quota", "-1", CVAR_ROM, NULL, crudefile_quota = Cvar_Get ("crudefile_quota", "-1", CVAR_ROM, NULL,
"Maximum space available to the Crude File " "Maximum space available to the Crude File "
"system, -1 to totally disable file writing"); "system, -1 to totally disable file writing");
@ -187,7 +187,7 @@ CF_CloseAllFiles ()
if (cf_filep[i].file) { if (cf_filep[i].file) {
Con_DPrintf ("Warning: closing Crude File %d left over from last " Con_DPrintf ("Warning: closing Crude File %d left over from last "
"map\n", i); "map\n", i);
CF_Close(i); CF_Close (i);
} }
} }
@ -211,11 +211,11 @@ CF_Open (const char *path, const char *mode)
} }
// check for paths with .. // check for paths with ..
if (strequal(path, "..") if (strequal (path, "..")
|| !strncmp(path, "../", 3) || !strncmp (path, "../", 3)
|| strstr(path, "/../") || strstr (path, "/../")
|| (strlen(path) >= 3 || (strlen (path) >= 3
&& strequal(path + strlen(path) - 3, "/.."))) { && strequal (path + strlen (path) - 3, "/.."))) {
return -1; return -1;
} }
@ -230,12 +230,12 @@ CF_Open (const char *path, const char *mode)
dsprintf (fullpath, "%s/%s/%s/%s", fs_userpath->string, dsprintf (fullpath, "%s/%s/%s/%s", fs_userpath->string,
qfs_gamedir->dir.def, CF_DIR, path); qfs_gamedir->dir.def, CF_DIR, path);
j = fullpath->str + strlen(fullpath->str) - strlen (path); j = fullpath->str + strlen (fullpath->str) - strlen (path);
for (i = 0; path[i]; i++, j++) // strcpy, but force lowercase for (i = 0; path[i]; i++, j++) // strcpy, but force lowercase
*j = tolower(path[i]); *j = tolower (path[i]);
*j = '\0'; *j = '\0';
if (CF_AlreadyOpen(fullpath->str, mode[0])) { if (CF_AlreadyOpen (fullpath->str, mode[0])) {
dstring_delete (fullpath); dstring_delete (fullpath);
return -1; return -1;
} }
@ -249,7 +249,7 @@ CF_Open (const char *path, const char *mode)
if (file) { if (file) {
if (cf_openfiles >= cf_filepcount) { if (cf_openfiles >= cf_filepcount) {
cf_filepcount++; cf_filepcount++;
cf_filep = realloc(cf_filep, sizeof(cf_file_t) * cf_filepcount); cf_filep = realloc (cf_filep, sizeof (cf_file_t) * cf_filepcount);
if (!cf_filep) { if (!cf_filep) {
Sys_Error ("CF_Open: memory allocation error!"); Sys_Error ("CF_Open: memory allocation error!");
} }
@ -285,21 +285,21 @@ CF_Close (int desc)
{ {
char *path; char *path;
if (!CF_ValidDesc(desc)) if (!CF_ValidDesc (desc))
return; return;
if (cf_filep[desc].mode == 'w' && !cf_filep[desc].writtento) if (cf_filep[desc].mode == 'w' && !cf_filep[desc].writtento)
unlink(cf_filep[desc].path); unlink (cf_filep[desc].path);
path = cf_filep[desc].path; path = cf_filep[desc].path;
Qclose (cf_filep[desc].file); Qclose (cf_filep[desc].file);
cf_filep[desc].file = 0; cf_filep[desc].file = 0;
free(cf_filep[desc].buf); free (cf_filep[desc].buf);
cf_openfiles--; cf_openfiles--;
cf_cursize -= CF_GetFileSize (path); cf_cursize -= CF_GetFileSize (path);
free(path); free (path);
} }
/* /*
@ -313,7 +313,7 @@ CF_Read (int desc)
{ {
int len = 0; int len = 0;
if (!CF_ValidDesc(desc) || cf_filep[desc].mode != 'r') { if (!CF_ValidDesc (desc) || cf_filep[desc].mode != 'r') {
return ""; return "";
} }
@ -328,7 +328,7 @@ CF_Read (int desc)
cf_filep[desc].buf = t; cf_filep[desc].buf = t;
cf_filep[desc].size += CF_BUFFERSIZE; cf_filep[desc].size += CF_BUFFERSIZE;
} }
foo = Qgetc(cf_filep[desc].file); foo = Qgetc (cf_filep[desc].file);
if (foo == EOF) if (foo == EOF)
foo = 0; foo = 0;
cf_filep[desc].buf[len] = (char) foo; cf_filep[desc].buf[len] = (char) foo;
@ -351,17 +351,17 @@ CF_Write (int desc, const char *buf) // should be const char *, but Qwrite isn't
{ {
int len; int len;
if (!CF_ValidDesc(desc) || cf_filep[desc].mode != 'w' || cf_cursize >= if (!CF_ValidDesc (desc) || cf_filep[desc].mode != 'w' || cf_cursize >=
cf_maxsize) { cf_maxsize) {
return 0; return 0;
} }
len = strlen(buf) + 1; len = strlen (buf) + 1;
if (len > cf_maxsize - cf_cursize) { if (len > cf_maxsize - cf_cursize) {
return 0; return 0;
} }
len = Qwrite(cf_filep[desc].file, buf, len); len = Qwrite (cf_filep[desc].file, buf, len);
if (len < 0) if (len < 0)
len = 0; len = 0;
@ -380,7 +380,7 @@ CF_Write (int desc, const char *buf) // should be const char *, but Qwrite isn't
int int
CF_EOF (int desc) CF_EOF (int desc)
{ {
if (!CF_ValidDesc(desc)) { if (!CF_ValidDesc (desc)) {
return -1; return -1;
} }
@ -390,11 +390,11 @@ CF_EOF (int desc)
/* /*
CF_Quota CF_Quota
cfquota returns the number of characters left in the quota, or returns the number of characters left in the quota, or <= 0 if it's met or
<= 0 if it's met or (somehow) exceeded. (somehow) exceeded.
*/ */
int int
CF_Quota() CF_Quota ()
{ {
return cf_maxsize - cf_cursize; return cf_maxsize - cf_cursize;
} }

View file

@ -83,7 +83,7 @@ locs_find (const vec3_t target)
{ {
int i; int i;
i = locs_nearest(target); i = locs_nearest (target);
if (i == -1) if (i == -1)
return NULL; return NULL;
return locations[i]; return locations[i];
@ -139,7 +139,7 @@ locs_load (const char *filename)
vec3_t loc; vec3_t loc;
QFile *file; QFile *file;
snprintf(tmp,sizeof(tmp), "maps/%s",filename); snprintf (tmp, sizeof (tmp), "maps/%s", filename);
templength = _QFS_FOpenFile (tmp, &file, foundname, 1); templength = _QFS_FOpenFile (tmp, &file, foundname, 1);
if (!file) { if (!file) {
Con_Printf ("Couldn't load %s\n", tmp); Con_Printf ("Couldn't load %s\n", tmp);
@ -156,7 +156,7 @@ locs_load (const char *filename)
if (t2 == t1) if (t2 == t1)
continue; continue;
loc[2] = strtol (t2, &t1, 0) * (1.0 / 8); loc[2] = strtol (t2, &t1, 0) * (1.0 / 8);
if ((t1 == t2) || (strlen(t1) < 2)) if ((t1 == t2) || (strlen (t1) < 2))
continue; continue;
t1++; t1++;
t2 = strrchr (t1, '\n'); t2 = strrchr (t1, '\n');
@ -199,31 +199,29 @@ locs_save (const char *filename, qboolean gz)
QFile *locfd; QFile *locfd;
if (gz) { if (gz) {
if (strncmp(filename + strlen(filename) - 3,".gz",3) != 0) if (strncmp (filename + strlen (filename) - 3,".gz", 3) != 0)
snprintf (locfile, sizeof (locfile), "%s.gz",filename); snprintf (locfile, sizeof (locfile), "%s.gz", filename);
else else
strcpy(locfile,filename); strcpy (locfile, filename);
locfd = Qopen (locfile,"z9w+"); locfd = Qopen (locfile, "z9w+");
} else } else
locfd = Qopen (filename,"w+"); locfd = Qopen (filename, "w+");
if (locfd == 0) { if (locfd == 0) {
Con_Printf("ERROR: Unable to open %s\n",filename); Con_Printf ("ERROR: Unable to open %s\n", filename);
return; return;
} }
for (i=0; i < locations_count; i++) for (i = 0; i < locations_count; i++)
Qprintf(locfd,"%.0f %.0f %.0f %s\n", Qprintf (locfd,"%.0f %.0f %.0f %s\n", locations[i]->loc[0] * 8,
locations[i]->loc[0] * 8, locations[i]->loc[1] * 8, locations[i]->loc[2] * 8,
locations[i]->loc[1] * 8, locations[i]->name);
locations[i]->loc[2] * 8,
locations[i]->name);
Qclose (locfd); Qclose (locfd);
} }
void void
locs_mark (const vec3_t loc, const char *desc) locs_mark (const vec3_t loc, const char *desc)
{ {
locs_add (loc,desc); locs_add (loc, desc);
Con_Printf ("Marked current location: %s\n",desc); Con_Printf ("Marked current location: %s\n", desc);
} }
/* /*
@ -240,7 +238,7 @@ locs_edit (const vec3_t loc, const char *desc)
if (locations_count) { if (locations_count) {
i = locs_nearest (loc); i = locs_nearest (loc);
if (!desc) { if (!desc) {
VectorCopy (loc,locations[i]->loc); VectorCopy (loc, locations[i]->loc);
Con_Printf ("Moving location marker for %s\n", Con_Printf ("Moving location marker for %s\n",
locations[i]->name); locations[i]->name);
} else { } else {
@ -277,10 +275,10 @@ map_to_loc (const char *mapname, char *filename)
{ {
char *t1; char *t1;
strcpy(filename, mapname); strcpy (filename, mapname);
t1 = strrchr(filename,'.'); t1 = strrchr (filename, '.');
if (!t1) if (!t1)
Sys_Error ("Can't find .!"); Sys_Error ("Can't find .!");
t1++; t1++;
strcpy(t1,"loc"); strcpy (t1, "loc");
} }

View file

@ -304,8 +304,8 @@ QW_SendHearts (int sock, msghdr_t *msghdr, server_t *servers, int serverlen)
p[1] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[1]; p[1] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[1];
p[2] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[2]; p[2] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[2];
p[3] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[3]; p[3] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[3];
p[4] = (unsigned char) (ntohs(servers[i].addr.sin_port) >> 8); p[4] = (unsigned char) (ntohs (servers[i].addr.sin_port) >> 8);
p[5] = (unsigned char) (ntohs(servers[i].addr.sin_port) & 0xFF); p[5] = (unsigned char) (ntohs (servers[i].addr.sin_port) & 0xFF);
++cpos; ++cpos;
} }
} }

View file

@ -298,7 +298,7 @@ Log_Outgoing_Packet (const char *p, int len, int has_sequence)
} }
static void static void
Log_Delta(int bits) Log_Delta (int bits)
{ {
entity_state_t to; entity_state_t to;
int i; int i;
@ -354,21 +354,21 @@ Log_Delta(int bits)
// Ender (QSG - Begin) // Ender (QSG - Begin)
if (bits & U_ALPHA) if (bits & U_ALPHA)
Net_LogPrintf(" Alpha: %d", MSG_ReadByte (&packet)); Net_LogPrintf (" Alpha: %d", MSG_ReadByte (&packet));
if (bits & U_SCALE) if (bits & U_SCALE)
Net_LogPrintf(" Scale: %d", MSG_ReadByte (&packet)); Net_LogPrintf (" Scale: %d", MSG_ReadByte (&packet));
if (bits & U_EFFECTS2) if (bits & U_EFFECTS2)
Net_LogPrintf(" U_EFFECTS2: %d", (to.effects & 0xFF) | Net_LogPrintf (" U_EFFECTS2: %d", (to.effects & 0xFF) |
(MSG_ReadByte (&packet) << 8)); (MSG_ReadByte (&packet) << 8));
if (bits & U_GLOWSIZE) if (bits & U_GLOWSIZE)
Net_LogPrintf(" GlowSize: %d", MSG_ReadByte (&packet)); Net_LogPrintf (" GlowSize: %d", MSG_ReadByte (&packet));
if (bits & U_GLOWCOLOR) if (bits & U_GLOWCOLOR)
Net_LogPrintf(" ColorGlow: %d", MSG_ReadByte (&packet)); Net_LogPrintf (" ColorGlow: %d", MSG_ReadByte (&packet));
if (bits & U_COLORMOD) if (bits & U_COLORMOD)
Net_LogPrintf(" Colormod: %d", MSG_ReadByte (&packet)); Net_LogPrintf (" Colormod: %d", MSG_ReadByte (&packet));
if (bits & U_FRAME2) if (bits & U_FRAME2)
Net_LogPrintf(" Uframe2: %d", ((to.frame & 0xFF) | Net_LogPrintf (" Uframe2: %d", ((to.frame & 0xFF) |
(MSG_ReadByte (&packet) << 8))); (MSG_ReadByte (&packet) << 8)));
// Ender (QSG - End) // Ender (QSG - End)
return; return;
@ -767,14 +767,14 @@ Parse_Server_Packet (int has_sequence)
break; break;
case svc_packetentities: case svc_packetentities:
while (1) { while (1) {
mask1 = (unsigned short) MSG_ReadShort(&packet); mask1 = (unsigned short) MSG_ReadShort (&packet);
if (packet.badread) { if (packet.badread) {
Net_LogPrintf ("Badread\n"); Net_LogPrintf ("Badread\n");
return; return;
} }
if (!mask1) break; if (!mask1) break;
if (mask1 & U_REMOVE) Net_LogPrintf("UREMOVE "); if (mask1 & U_REMOVE) Net_LogPrintf ("UREMOVE ");
Log_Delta(mask1); Log_Delta (mask1);
} }
break; break;
case svc_deltapacketentities: case svc_deltapacketentities:

View file

@ -926,12 +926,12 @@ Sbar_LogFrags (void)
char num[512]; char num[512];
char conv[512]; char conv[512];
char conv2[512]; char conv2[512];
char *cp = NULL; char *cp = NULL;
QFile *file = NULL; QFile *file = NULL;
int minutes, fph, total, f, i, k, l, p, d; int minutes, fph, total, d, f, i, k, l, p;
player_info_t *s = NULL; player_info_t *s = NULL;
const char *t = NULL; const char *t = NULL;
time_t tt = time(NULL); time_t tt = time (NULL);
char e_path[MAX_OSPATH]; char e_path[MAX_OSPATH];
if (!cl_fraglog->int_val) if (!cl_fraglog->int_val)
@ -1004,19 +1004,19 @@ Sbar_LogFrags (void)
d++) d++)
conv2[d] = sys_char_map[(unsigned int) *cp]; conv2[d] = sys_char_map[(unsigned int) *cp];
snprintf(num, sizeof (num), "%-3i%% %-3i %-4i %-3i " snprintf (num, sizeof (num), "%-3i%% %-3i %-4i %-3i "
"%-4s %s", s->pl, fph, minutes, f, (char *) &conv2, "%-4s %s", s->pl, fph, minutes, f, (char *) &conv2,
(char *) &conv); (char *) &conv);
} else { } else {
snprintf(num, sizeof (num), "%-3i%% %-3i %-4i %-3i %s", snprintf (num, sizeof (num), "%-3i%% %-3i %-4i %-3i %s",
s->pl, fph, minutes, f, (char *) &conv); s->pl, fph, minutes, f, (char *) &conv);
} }
} }
Qwrite(file, num, strlen(num)); Qwrite (file, num, strlen (num));
Qwrite(file, "\n\n", 1); Qwrite (file, "\n\n", 1);
} }
Qclose(file); Qclose (file);
} }
static void static void

View file

@ -219,7 +219,7 @@ SV_Fraglogfile_f (void)
/* /*
SV_SetPlayer SV_SetPlayer
Sets host_client and sv_player to the player with idnum Cmd_Argv(1) Sets host_client and sv_player to the player with idnum Cmd_Argv (1)
*/ */
static qboolean static qboolean
SV_SetPlayer (void) SV_SetPlayer (void)
@ -434,7 +434,7 @@ SV_Kick_f (void)
SV_Printf ("usage: kick <name/userid>\n"); SV_Printf ("usage: kick <name/userid>\n");
return; return;
} }
if (!(cl = SV_Match_User (Cmd_Argv(1)))) if (!(cl = SV_Match_User (Cmd_Argv (1))))
return; return;
SV_BroadcastPrintf (PRINT_HIGH, "%s was kicked\n", cl->name); SV_BroadcastPrintf (PRINT_HIGH, "%s was kicked\n", cl->name);
@ -560,31 +560,30 @@ SV_Cuff_f (void)
client_t *cl = 0; client_t *cl = 0;
char text[1024]; char text[1024];
if (Cmd_Argc() != 2 && Cmd_Argc() != 3) { if (Cmd_Argc () != 2 && Cmd_Argc () != 3) {
SV_Printf ("usage: cuff <name/userid/ALL> [minutes]\n" SV_Printf ("usage: cuff <name/userid/ALL> [minutes]\n"
" (default = 0.5, 0 = cancel cuff).\n"); " (default = 0.5, 0 = cancel cuff).\n");
return; return;
} }
if (strequal (Cmd_Argv(1), "ALL")) { if (strequal (Cmd_Argv (1), "ALL")) {
all = true; all = true;
} else { } else {
cl = SV_Match_User (Cmd_Argv(1)); cl = SV_Match_User (Cmd_Argv (1));
} }
if (!all && !cl) if (!all && !cl)
return; return;
if (Cmd_Argc() == 3) { if (Cmd_Argc () == 3) {
mins = atof(Cmd_Argv(2)); mins = atof (Cmd_Argv (2));
if (mins < 0.0 || mins > MAXPENALTY) if (mins < 0.0 || mins > MAXPENALTY)
mins = MAXPENALTY; mins = MAXPENALTY;
} }
if (cl) { if (cl) {
cl->cuff_time = realtime + mins*60.0; cl->cuff_time = realtime + mins * 60.0;
if (mins) { if (mins) {
sprintf(text, sprintf (text, "You are cuffed for %.1f minutes\n\n"
"You are cuffed for %.1f minutes\n\n" "reconnecting won't help...\n", mins);
"reconnecting won't help...\n", mins); ClientReliableWrite_Begin (cl, svc_centerprint, 2 + strlen (text));
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text));
ClientReliableWrite_String (cl, text); ClientReliableWrite_String (cl, text);
} }
} }
@ -592,13 +591,13 @@ SV_Cuff_f (void)
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) { for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
if (cl->state < cs_zombie) if (cl->state < cs_zombie)
continue; continue;
cl->cuff_time = realtime + mins*60.0; cl->cuff_time = realtime + mins * 60.0;
done = true; done = true;
if (mins) { if (mins) {
sprintf(text, sprintf (text, "You are cuffed for %.1f minutes\n\n"
"You are cuffed for %.1f minutes\n\n" "reconnecting won't help...\n", mins);
"reconnecting won't help...\n", mins); ClientReliableWrite_Begin (cl, svc_centerprint,
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text)); 2 + strlen (text));
ClientReliableWrite_String (cl, text); ClientReliableWrite_String (cl, text);
} }
} }
@ -623,30 +622,30 @@ SV_Mute_f (void)
client_t *cl = 0; client_t *cl = 0;
char text[1024]; char text[1024];
if (Cmd_Argc() != 2 && Cmd_Argc() != 3) { if (Cmd_Argc () != 2 && Cmd_Argc () != 3) {
SV_Printf ("usage: mute <name/userid/ALL> [minutes]\n" SV_Printf ("usage: mute <name/userid/ALL> [minutes]\n"
" (default = 0.5, 0 = cancel mute).\n"); " (default = 0.5, 0 = cancel mute).\n");
return; return;
} }
if (strequal(Cmd_Argv(1),"ALL")) { if (strequal (Cmd_Argv (1),"ALL")) {
all = true; all = true;
} else { } else {
cl = SV_Match_User (Cmd_Argv(1)); cl = SV_Match_User (Cmd_Argv (1));
} }
if (!all && !cl) if (!all && !cl)
return; return;
if (Cmd_Argc() == 3) { if (Cmd_Argc () == 3) {
mins = atof(Cmd_Argv(2)); mins = atof (Cmd_Argv (2));
if (mins < 0.0 || mins > MAXPENALTY) if (mins < 0.0 || mins > MAXPENALTY)
mins = MAXPENALTY; mins = MAXPENALTY;
} }
if (cl) { if (cl) {
cl->lockedtill = realtime + mins*60.0; cl->lockedtill = realtime + mins * 60.0;
done = true; done = true;
if (mins) { if (mins) {
sprintf(text, "You are muted for %.1f minutes\n\n" sprintf (text, "You are muted for %.1f minutes\n\n"
"reconnecting won't help...\n", mins); "reconnecting won't help...\n", mins);
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text)); ClientReliableWrite_Begin (cl, svc_centerprint, 2 + strlen (text));
ClientReliableWrite_String (cl, text); ClientReliableWrite_String (cl, text);
} }
} }
@ -654,12 +653,13 @@ SV_Mute_f (void)
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) { for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
if (cl->state < cs_zombie) if (cl->state < cs_zombie)
continue; continue;
cl->lockedtill = realtime + mins*60.0; cl->lockedtill = realtime + mins * 60.0;
done = true; done = true;
if (mins) { if (mins) {
sprintf(text, "You are muted for %.1f minutes\n\n" sprintf (text, "You are muted for %.1f minutes\n\n"
"reconnecting won't help...\n", mins); "reconnecting won't help...\n", mins);
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text)); ClientReliableWrite_Begin (cl, svc_centerprint,
2 + strlen (text));
ClientReliableWrite_String (cl, text); ClientReliableWrite_String (cl, text);
} }
} }
@ -686,10 +686,10 @@ SV_Tell (const char *prefix)
SV_Printf ("usage: tell <name/userid> <text...>\n"); SV_Printf ("usage: tell <name/userid> <text...>\n");
return; return;
} }
if (!(cl = SV_Match_User (Cmd_Argv(1)))) if (!(cl = SV_Match_User (Cmd_Argv (1))))
return; return;
p = Hunk_TempAlloc (strlen(Cmd_Args (2)) + 1); p = Hunk_TempAlloc (strlen (Cmd_Args (2)) + 1);
strcpy (p, Cmd_Args (2)); strcpy (p, Cmd_Args (2));
if (*p == '"') { if (*p == '"') {
p++; p++;
@ -714,36 +714,36 @@ SV_Ban_f (void)
double mins = 30.0; double mins = 30.0;
client_t *cl; client_t *cl;
if (Cmd_Argc() != 2 && Cmd_Argc() != 3) { if (Cmd_Argc () != 2 && Cmd_Argc () != 3) {
SV_Printf ("usage: ban <name/userid> [minutes]\n" SV_Printf ("usage: ban <name/userid> [minutes]\n"
" (default = 30, 0 = permanent).\n"); " (default = 30, 0 = permanent).\n");
return; return;
} }
if (!(cl = SV_Match_User(Cmd_Argv(1)))) if (!(cl = SV_Match_User (Cmd_Argv (1))))
return; return;
if (Cmd_Argc() == 3) { if (Cmd_Argc () == 3) {
mins = atof(Cmd_Argv(2)); mins = atof (Cmd_Argv (2));
if (mins<0.0 || mins > 1000000.0) // bout 2 yrs if (mins < 0.0 || mins > 1000000.0) // bout 2 yrs
mins = 0.0; mins = 0.0;
} }
SV_BroadcastPrintf (PRINT_HIGH, "Admin Banned user %s %s\n", SV_BroadcastPrintf (PRINT_HIGH, "Admin Banned user %s %s\n",
cl->name, mins ? va("for %.1f minutes", mins) cl->name, mins ? va ("for %.1f minutes", mins)
: "permanently"); : "permanently");
SV_DropClient (cl); SV_DropClient (cl);
Cmd_ExecuteString (va ("addip %s %f", Cmd_ExecuteString (va ("addip %s %f",
NET_BaseAdrToString(cl->netchan.remote_address), NET_BaseAdrToString (cl->netchan.remote_address),
mins), src_command); mins), src_command);
} }
static void static void
SV_Match_f (void) SV_Match_f (void)
{ {
if (Cmd_Argc() != 2) { if (Cmd_Argc () != 2) {
SV_Printf ("usage: match <name/userid>\n"); SV_Printf ("usage: match <name/userid>\n");
return; return;
} }
if (!SV_Match_User (Cmd_Argv(1))) if (!SV_Match_User (Cmd_Argv (1)))
SV_Printf ("No unique uid/name matched\n"); SV_Printf ("No unique uid/name matched\n");
} }
@ -759,7 +759,7 @@ SV_ConSay (const char *prefix)
if (Cmd_Argc () < 2) if (Cmd_Argc () < 2)
return; return;
p = Hunk_TempAlloc (strlen(Cmd_Args (1)) + 1); p = Hunk_TempAlloc (strlen (Cmd_Args (1)) + 1);
strcpy (p, Cmd_Args (1)); strcpy (p, Cmd_Args (1));
if (*p == '"') { if (*p == '"') {
p++; p++;
@ -801,15 +801,15 @@ static void
SV_ConSay_f (void) SV_ConSay_f (void)
{ {
if (rcon_from_user) if (rcon_from_user)
SV_ConSay("Admin"); SV_ConSay ("Admin");
else else
SV_ConSay("Console"); SV_ConSay ("Console");
} }
static void static void
SV_ConSay_Info_f (void) SV_ConSay_Info_f (void)
{ {
SV_ConSay("Info"); SV_ConSay ("Info");
} }
static void static void

View file

@ -56,12 +56,10 @@ demo_t demo;
#define MIN_DEMO_MEMORY 0x100000 #define MIN_DEMO_MEMORY 0x100000
#define USACACHE (sv_demoUseCache->int_val && svs.demomemsize) #define USACACHE (sv_demoUseCache->int_val && svs.demomemsize)
#define DWRITE(a,b,d) dwrite((QFile *)d,a,b) #define DWRITE(a,b,d) dwrite((QFile *) d, a, b)
#define MAXSIZE (demobuffer->end < demobuffer->last ? \ #define MAXSIZE (demobuffer->end < demobuffer->last ? \
demobuffer->start - demobuffer->end : \ demobuffer->start - demobuffer->end : \
demobuffer->maxsize - demobuffer->end) demobuffer->maxsize - demobuffer->end)
static int demo_max_size; static int demo_max_size;
static int demo_size; static int demo_size;
@ -717,7 +715,7 @@ SV_WriteSetDemoMessage (void)
int len; int len;
byte c; byte c;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf ("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
if (!sv.demorecording) if (!sv.demorecording)
return; return;
@ -1217,13 +1215,14 @@ SV_EasyRecord_f (void)
Dem_PlayerName (1), Dem_PlayerName (2), sv.name); Dem_PlayerName (1), Dem_PlayerName (2), sv.name);
} else { } else {
// FFA // FFA
dsprintf (name, "ffa_%s(%d)", sv.name, i); dsprintf (name, "ffa_%s (%d)", sv.name, i);
} }
} }
} }
// Make sure the filename doesn't contain illegal characters // Make sure the filename doesn't contain illegal characters
dsprintf (name2, "%s/%s/%s/%s%s%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string, dsprintf (name2, "%s/%s/%s/%s%s%s", fs_userpath->string,
qfs_gamedir->dir.def, sv_demoDir->string,
sv_demoPrefix->string, SV_CleanName (name->str), sv_demoPrefix->string, SV_CleanName (name->str),
sv_demoSuffix->string); sv_demoSuffix->string);
QFS_CreatePath (name2->str); QFS_CreatePath (name2->str);

View file

@ -372,7 +372,7 @@ SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *msg)
client->netchan.incoming_sequence & UPDATE_MASK, client->netchan.incoming_sequence & UPDATE_MASK,
client->delta_sequence & UPDATE_MASK); client->delta_sequence & UPDATE_MASK);
if (!client->edict) if (!client->edict)
Sys_Printf("demo\n"); Sys_Printf ("demo\n");
} }
ent = EDICT_NUM (&sv_pr_state, newnum); ent = EDICT_NUM (&sv_pr_state, newnum);
// SV_Printf ("baseline %i\n", newnum); // SV_Printf ("baseline %i\n", newnum);

View file

@ -71,12 +71,12 @@ SV_GIB_Client_GetList_f (void)
client_t *cl; client_t *cl;
int i; int i;
if (GIB_Argc() != 1) if (GIB_Argc () != 1)
GIB_USAGE(""); GIB_USAGE ("");
else if (GIB_CanReturn()) else if (GIB_CanReturn ())
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++)
if (cl->state >= cs_connected) if (cl->state >= cs_connected)
dsprintf (GIB_Return(0), "%i", cl->userid); dsprintf (GIB_Return (0), "%i", cl->userid);
} }
static void static void
@ -84,14 +84,16 @@ SV_GIB_Client_GetKeys_f (void)
{ {
client_t *cl; client_t *cl;
if (GIB_Argc() != 2) if (GIB_Argc () != 2)
GIB_USAGE(""); GIB_USAGE ("");
else if (!(cl = SV_GIB_GetClient (atoi(GIB_Argv(1))))) else if (!(cl = SV_GIB_GetClient (atoi (GIB_Argv (1)))))
GIB_Error ("uid", "No user with id '%s' was found on the server.", GIB_Argv(1)); GIB_Error ("uid", "No user with id '%s' was found on the server.",
GIB_Argv (1));
else if (GIB_CanReturn ()) { else if (GIB_CanReturn ()) {
info_key_t **key, **keys = (info_key_t **) Hash_GetList (cl->userinfo->tab); info_key_t **key, **keys =
(info_key_t **) Hash_GetList (cl->userinfo->tab);
for (key = keys; *key; key++) for (key = keys; *key; key++)
dstring_appendstr (GIB_Return(0), (*key)->key); dstring_appendstr (GIB_Return (0), (*key)->key);
free (keys); free (keys);
} }
} }
@ -102,11 +104,12 @@ SV_GIB_Client_GetInfo_f (void)
client_t *cl; client_t *cl;
const char *str; const char *str;
if (GIB_Argc() != 3) if (GIB_Argc () != 3)
GIB_USAGE(""); GIB_USAGE ("");
else if (!(cl = SV_GIB_GetClient (atoi(GIB_Argv(1))))) else if (!(cl = SV_GIB_GetClient (atoi (GIB_Argv (1)))))
GIB_Error ("uid", "No user with id '%s' was found on the server.", GIB_Argv(1)); GIB_Error ("uid", "No user with id '%s' was found on the server.",
else if ((str = Info_ValueForKey (cl->userinfo, GIB_Argv(2)))) GIB_Argv (1));
else if ((str = Info_ValueForKey (cl->userinfo, GIB_Argv (2))))
GIB_Return (str); GIB_Return (str);
} }
@ -115,25 +118,27 @@ SV_GIB_Client_Print_f (void)
{ {
client_t *cl; client_t *cl;
if (GIB_Argc() != 3) if (GIB_Argc () != 3)
GIB_USAGE("uid message"); GIB_USAGE ("uid message");
else if (!(cl = SV_GIB_GetClient (atoi(GIB_Argv(1))))) else if (!(cl = SV_GIB_GetClient (atoi (GIB_Argv (1)))))
GIB_Error ("uid", "No user with id '%s' was found on the server.", GIB_Argv(1)); GIB_Error ("uid", "No user with id '%s' was found on the server.",
GIB_Argv (1));
else else
SV_ClientPrintf (0, cl, GIB_Argv(0)[13] ? PRINT_CHAT : PRINT_HIGH, "%s", GIB_Argv(2)); SV_ClientPrintf (0, cl, GIB_Argv (0)[13] ? PRINT_CHAT : PRINT_HIGH,
"%s", GIB_Argv (2));
} }
static void static void
SV_GIB_Client_Print_All_f (void) SV_GIB_Client_Print_All_f (void)
{ {
client_t *cl; client_t *cl;
int i, level = GIB_Argv(0)[16] ? PRINT_CHAT : PRINT_HIGH; int i, level = GIB_Argv (0)[16] ? PRINT_CHAT : PRINT_HIGH;
if (GIB_Argc() != 2) if (GIB_Argc () != 2)
GIB_USAGE("message"); GIB_USAGE ("message");
else for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) else for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++)
if (cl->state >= cs_connected) if (cl->state >= cs_connected)
SV_ClientPrintf (0, cl, level, "%s", GIB_Argv(1)); SV_ClientPrintf (0, cl, level, "%s", GIB_Argv (1));
} }
void void

View file

@ -297,7 +297,7 @@ SV_CheckModel (const char *mdl)
Change the server to a new map, taking all connected Change the server to a new map, taking all connected
clients along with it. clients along with it.
This is only called from the SV_Map_f() function. This is only called from the SV_Map_f () function.
*/ */
void void
SV_SpawnServer (const char *server) SV_SpawnServer (const char *server)

View file

@ -260,7 +260,7 @@ SV_Shutdown (void)
sv_fraglogfile = NULL; sv_fraglogfile = NULL;
} }
if (sv.demorecording) if (sv.demorecording)
SV_Stop_f(); SV_Stop_f ();
NET_Shutdown (); NET_Shutdown ();
Con_Shutdown (); Con_Shutdown ();
@ -386,7 +386,8 @@ SV_DropClient (client_t *drop)
// Trigger GIB event // Trigger GIB event
if (sv_client_disconnect_e->func) if (sv_client_disconnect_e->func)
GIB_Event_Callback (sv_client_disconnect_e, 1, va("%u", drop->userid)); GIB_Event_Callback (sv_client_disconnect_e, 1,
va ("%u", drop->userid));
} }
int int
@ -432,7 +433,7 @@ SV_FullClientUpdate (client_t *client, sizebuf_t *buf)
i = client - svs.clients; i = client - svs.clients;
// SV_Printf("SV_FullClientUpdate: Updated frags for client %d\n", i); // SV_Printf ("SV_FullClientUpdate: Updated frags for client %d\n", i);
MSG_WriteByte (buf, svc_updatefrags); MSG_WriteByte (buf, svc_updatefrags);
MSG_WriteByte (buf, i); MSG_WriteByte (buf, i);
@ -648,9 +649,9 @@ SVC_Log (void)
Con_DPrintf ("sending log %i to %s\n", svs.logsequence - 1, Con_DPrintf ("sending log %i to %s\n", svs.logsequence - 1,
NET_AdrToString (net_from)); NET_AdrToString (net_from));
// snprintf (data, sizeof (data), "stdlog %i\n", svs.logsequence-1); // snprintf (data, sizeof (data), "stdlog %i\n", svs.logsequence - 1);
// strncat (data, (char *)svs.log_buf[((svs.logsequence-1)&1)], // strncat (data, (char *) svs.log_buf[((svs.logsequence - 1) & 1)],
// sizeof(data) - strlen (data)); // sizeof (data) - strlen (data));
snprintf (data, sizeof (data), "stdlog %i\n%s", snprintf (data, sizeof (data), "stdlog %i\n%s",
svs.logsequence - 1, svs.logsequence - 1,
(char *) svs.log_buf[((svs.logsequence - 1) & 1)]); (char *) svs.log_buf[((svs.logsequence - 1) & 1)]);
@ -925,7 +926,7 @@ SVC_DirectConnect (void)
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
newcl->whensaid[i] = 0.0; newcl->whensaid[i] = 0.0;
newcl->whensaidhead = 0; newcl->whensaidhead = 0;
newcl->lockedtill = SV_RestorePenaltyFilter(newcl, ft_mute); newcl->lockedtill = SV_RestorePenaltyFilter (newcl, ft_mute);
// call the progs to get default spawn parms for the new client // call the progs to get default spawn parms for the new client
PR_ExecuteProgram (&sv_pr_state, sv_funcs.SetNewParms); PR_ExecuteProgram (&sv_pr_state, sv_funcs.SetNewParms);
@ -945,7 +946,7 @@ SVC_DirectConnect (void)
newcl->msec_cheating = 0; newcl->msec_cheating = 0;
newcl->last_check = -1; newcl->last_check = -1;
newcl->cuff_time = SV_RestorePenaltyFilter(newcl, ft_cuff); newcl->cuff_time = SV_RestorePenaltyFilter (newcl, ft_cuff);
} }
static int static int
@ -969,7 +970,7 @@ Name_of_sender (void)
for (i=0, cl=svs.clients ; i<MAX_CLIENTS ; i++,cl++) { for (i=0, cl=svs.clients ; i<MAX_CLIENTS ; i++,cl++) {
if (cl->state < cs_zombie) if (cl->state < cs_zombie)
continue; continue;
if (!NET_CompareBaseAdr(net_from, cl->netchan.remote_address)) if (!NET_CompareBaseAdr (net_from, cl->netchan.remote_address))
continue; continue;
if (cl->netchan.remote_address.port != net_from.port) if (cl->netchan.remote_address.port != net_from.port)
continue; continue;
@ -1000,27 +1001,27 @@ SVC_RemoteCommand (void)
do_cmd = true; do_cmd = true;
} else if (Rcon_Validate (admin_password)) { } else if (Rcon_Validate (admin_password)) {
admin_cmd = true; admin_cmd = true;
if (strcmp(Cmd_Argv(2), "say") == 0 if (strcmp (Cmd_Argv (2), "say") == 0
|| strcmp(Cmd_Argv(2), "kick") == 0 || strcmp (Cmd_Argv (2), "kick") == 0
|| strcmp(Cmd_Argv(2), "ban") == 0 || strcmp (Cmd_Argv (2), "ban") == 0
|| strcmp(Cmd_Argv(2), "mute") == 0 || strcmp (Cmd_Argv (2), "mute") == 0
|| strcmp(Cmd_Argv(2), "cuff") == 0 || strcmp (Cmd_Argv (2), "cuff") == 0
|| strcmp(Cmd_Argv(2), "exec") == 0 || strcmp (Cmd_Argv (2), "exec") == 0
|| strcmp(Cmd_Argv(2), "addip") == 0 || strcmp (Cmd_Argv (2), "addip") == 0
|| strcmp(Cmd_Argv(2), "listip") == 0 || strcmp (Cmd_Argv (2), "listip") == 0
|| strcmp(Cmd_Argv(2), "writeip") == 0 || strcmp (Cmd_Argv (2), "writeip") == 0
|| strcmp(Cmd_Argv(2), "removeip") == 0) || strcmp (Cmd_Argv (2), "removeip") == 0)
do_cmd = true; do_cmd = true;
} }
if ((name = Name_of_sender())) { // log issuer if ((name = Name_of_sender ())) { // log issuer
if (do_cmd && admin_cmd) { if (do_cmd && admin_cmd) {
SV_BroadcastPrintf (PRINT_HIGH, "Admin %s issued %s command:\n", SV_BroadcastPrintf (PRINT_HIGH, "Admin %s issued %s command:\n",
name, Cmd_Argv(2)); name, Cmd_Argv (2));
} else if (admin_cmd) { } else if (admin_cmd) {
SV_Printf ("Admin %s issued %s command:\n", name, Cmd_Argv(2)); SV_Printf ("Admin %s issued %s command:\n", name, Cmd_Argv (2));
} else { } else {
SV_Printf("User %s %s rcon command:\n", name, SV_Printf ("User %s %s rcon command:\n", name,
do_cmd? "issued":"attempted"); do_cmd ? "issued" : "attempted");
} }
} }
@ -1041,7 +1042,7 @@ SVC_RemoteCommand (void)
SV_BeginRedirect (RD_PACKET); SV_BeginRedirect (RD_PACKET);
if (admin_cmd) { if (admin_cmd) {
SV_Printf("Command not valid with admin password.\n"); SV_Printf ("Command not valid with admin password.\n");
} else { } else {
SV_Printf ("Bad rcon_password.\n"); SV_Printf ("Bad rcon_password.\n");
} }
@ -1752,8 +1753,8 @@ SV_ReadPackets (void)
good = false; good = false;
while (NET_GetPacket ()) { while (NET_GetPacket ()) {
if (net_packetlog->int_val) if (net_packetlog->int_val)
Log_Incoming_Packet(net_message->message->data, Log_Incoming_Packet (net_message->message->data,
net_message->message->cursize, 1); net_message->message->cursize, 1);
if (SV_FilterIP (net_from.ip, &until)) { if (SV_FilterIP (net_from.ip, &until)) {
SV_SendBan (until); // tell them we aren't listening... SV_SendBan (until); // tell them we aren't listening...
continue; continue;
@ -1804,7 +1805,7 @@ SV_ReadPackets (void)
// packet is not from a known client // packet is not from a known client
// SV_Printf ("%s:sequenced packet without connection\n", // SV_Printf ("%s:sequenced packet without connection\n",
// NET_AdrToString(net_from)); // NET_AdrToString (net_from));
} }
} }
@ -2368,8 +2369,8 @@ SV_ExtractFromUserinfo (client_t *cl)
"different name.\n", A2C_PRINT); "different name.\n", A2C_PRINT);
SV_ClientPrintf (1, cl, PRINT_HIGH, "Please choose a " SV_ClientPrintf (1, cl, PRINT_HIGH, "Please choose a "
"different name.\n"); "different name.\n");
SV_Printf("Client %d kicked for having a invalid name\n", SV_Printf ("Client %d kicked for having a invalid name\n",
cl->userid); cl->userid);
cl->drop = true; cl->drop = true;
return; return;
} }
@ -2435,7 +2436,7 @@ SV_InitNet (void)
Netchan_Init (); Netchan_Init ();
Net_Log_Init(sv.sound_precache); Net_Log_Init (sv.sound_precache);
svs.last_heartbeat = -99999; // send immediately svs.last_heartbeat = -99999; // send immediately
sv_net_initialized = 1; sv_net_initialized = 1;

View file

@ -65,7 +65,7 @@ static __attribute__ ((unused)) const char rcsid[] =
This is a TERMINAL error, which will kill off the entire server. This is a TERMINAL error, which will kill off the entire server.
Dumps self. Dumps self.
error(value) error (value)
*/ */
void void
PF_error (progs_t *pr) PF_error (progs_t *pr)
@ -88,7 +88,7 @@ PF_error (progs_t *pr)
Dumps out self, then an error message. The program is aborted and self is Dumps out self, then an error message. The program is aborted and self is
removed, but the level can continue. removed, but the level can continue.
objerror(value) objerror (value)
*/ */
void void
PF_objerror (progs_t *pr) PF_objerror (progs_t *pr)
@ -110,7 +110,7 @@ PF_objerror (progs_t *pr)
PF_makevectors PF_makevectors
Writes new values for v_forward, v_up, and v_right based on angles Writes new values for v_forward, v_up, and v_right based on angles
makevectors(vector) makevectors (vector)
*/ */
void void
PF_makevectors (progs_t *pr) PF_makevectors (progs_t *pr)
@ -207,12 +207,12 @@ PF_setmodel (progs_t *pr)
broadcast print to everyone on server broadcast print to everyone on server
bprint(value) bprint (value)
*/ */
void void
PF_bprint (progs_t *pr) PF_bprint (progs_t *pr)
{ {
const char *s; const char *s;
int level; int level;
level = P_FLOAT (pr, 0); level = P_FLOAT (pr, 0);
@ -226,12 +226,12 @@ PF_bprint (progs_t *pr)
single print to a specific client single print to a specific client
sprint(clientent, value) sprint (clientent, value)
*/ */
void void
PF_sprint (progs_t *pr) PF_sprint (progs_t *pr)
{ {
const char *s; const char *s;
client_t *client; client_t *client;
int entnum, level; int entnum, level;
@ -258,12 +258,12 @@ PF_sprint (progs_t *pr)
single print to a specific client single print to a specific client
centerprint(clientent, value) centerprint (clientent, value)
*/ */
void void
PF_centerprint (progs_t *pr) PF_centerprint (progs_t *pr)
{ {
const char *s; const char *s;
client_t *cl; client_t *cl;
int entnum; int entnum;
@ -590,7 +590,7 @@ PF_stuffcmd (progs_t *pr)
ClientReliableWrite_Begin (cl, svc_stufftext, 2 + p - buf); ClientReliableWrite_Begin (cl, svc_stufftext, 2 + p - buf);
ClientReliableWrite_String (cl, buf); ClientReliableWrite_String (cl, buf);
if (sv.demorecording) { if (sv.demorecording) {
DemoWrite_Begin (dem_single, cl - svs.clients, 2 + strlen(buf)); DemoWrite_Begin (dem_single, cl - svs.clients, 2 + strlen (buf));
MSG_WriteByte (&demo.dbuf->sz, svc_stufftext); MSG_WriteByte (&demo.dbuf->sz, svc_stufftext);
MSG_WriteString (&demo.dbuf->sz, buf); MSG_WriteString (&demo.dbuf->sz, buf);
} }
@ -756,7 +756,7 @@ PF_precache_model (progs_t *pr)
/* /*
PF_walkmove PF_walkmove
float(float yaw, float dist) walkmove float (float yaw, float dist) walkmove
*/ */
void void
PF_walkmove (progs_t *pr) PF_walkmove (progs_t *pr)
@ -796,7 +796,7 @@ PF_walkmove (progs_t *pr)
/* /*
PF_droptofloor PF_droptofloor
void() droptofloor void () droptofloor
*/ */
void void
PF_droptofloor (progs_t *pr) PF_droptofloor (progs_t *pr)
@ -827,7 +827,7 @@ PF_droptofloor (progs_t *pr)
/* /*
PF_lightstyle PF_lightstyle
void(float style, string value) lightstyle void (float style, string value) lightstyle
*/ */
void void
PF_lightstyle (progs_t *pr) PF_lightstyle (progs_t *pr)
@ -890,7 +890,7 @@ cvar_t *sv_aim;
PF_aim PF_aim
Pick a vector for the player to shoot along Pick a vector for the player to shoot along
vector aim(entity, missilespeed) vector aim (entity, missilespeed)
*/ */
void void
PF_aim (progs_t *pr) PF_aim (progs_t *pr)
@ -1020,7 +1020,7 @@ PF_changeyaw (progs_t *pr)
#define MSG_ONE 1 // reliable to one (msg_entity) #define MSG_ONE 1 // reliable to one (msg_entity)
#define MSG_ALL 2 // reliable to all #define MSG_ALL 2 // reliable to all
#define MSG_INIT 3 // write to the init string #define MSG_INIT 3 // write to the init string
#define MSG_MULTICAST 4 // for multicast() #define MSG_MULTICAST 4 // for multicast ()
static sizebuf_t * static sizebuf_t *
WriteDest (progs_t *pr) WriteDest (progs_t *pr)
@ -1386,7 +1386,7 @@ PF_logfrag (progs_t *pr)
/* /*
PF_infokey PF_infokey
string(entity e, string key) infokey string (entity e, string key) infokey
*/ */
void void
PF_infokey (progs_t *pr) PF_infokey (progs_t *pr)
@ -1433,7 +1433,7 @@ PF_infokey (progs_t *pr)
/* /*
PF_multicast PF_multicast
void(vector where, float set) multicast void (vector where, float set) multicast
*/ */
void void
PF_multicast (progs_t *pr) PF_multicast (progs_t *pr)
@ -1450,7 +1450,7 @@ PF_multicast (progs_t *pr)
/* /*
PF_cfopen PF_cfopen
float(string path, string mode) cfopen float (string path, string mode) cfopen
*/ */
static void static void
PF_cfopen (progs_t *pr) PF_cfopen (progs_t *pr)
@ -1478,7 +1478,7 @@ PF_cfclose (progs_t *pr)
static void static void
PF_cfread (progs_t *pr) PF_cfread (progs_t *pr)
{ {
RETURN_STRING (pr, CF_Read((int) P_FLOAT (pr, 0))); RETURN_STRING (pr, CF_Read ((int) P_FLOAT (pr, 0)));
} }
/* /*
@ -1489,7 +1489,7 @@ PF_cfread (progs_t *pr)
static void static void
PF_cfwrite (progs_t *pr) PF_cfwrite (progs_t *pr)
{ {
R_FLOAT (pr) = CF_Write((int) P_FLOAT (pr, 0), P_STRING (pr, 1)); R_FLOAT (pr) = CF_Write ((int) P_FLOAT (pr, 0), P_STRING (pr, 1));
} }
/* /*
@ -1511,7 +1511,7 @@ PF_cfeof (progs_t *pr)
static void static void
PF_cfquota (progs_t *pr) PF_cfquota (progs_t *pr)
{ {
R_FLOAT (pr) = CF_Quota(); R_FLOAT (pr) = CF_Quota ();
} }
static void static void
@ -1731,7 +1731,7 @@ PF_Fixme (progs_t *pr)
static void static void
PF_Checkextension (progs_t *pr) PF_Checkextension (progs_t *pr)
{ {
R_FLOAT(pr) = 0; //FIXME make this function actually useful :P R_FLOAT (pr) = 0; // FIXME: make this function actually useful :P
} }
static void static void
@ -1782,7 +1782,7 @@ PF_SV_FreeClient (progs_t *pr)
cl->state = cs_free; cl->state = cs_free;
//if (sv_client_disconnect_e->func) //if (sv_client_disconnect_e->func)
// GIB_Event_Callback (sv_client_disconnect_e, 2, va("%u", cl->userid), // GIB_Event_Callback (sv_client_disconnect_e, 2, va ("%u", cl->userid),
// "server"); // "server");
} }
@ -1845,7 +1845,7 @@ SV_PR_Cmds_Init ()
PR_AddBuiltin (&sv_pr_state, "makevectors", PF_makevectors, 1); // void (entity e) makevectors PR_AddBuiltin (&sv_pr_state, "makevectors", PF_makevectors, 1); // void (entity e) makevectors
PR_AddBuiltin (&sv_pr_state, "setorigin", PF_setorigin, 2); // void (entity e, vector o) setorigin PR_AddBuiltin (&sv_pr_state, "setorigin", PF_setorigin, 2); // void (entity e, vector o) setorigin
PR_AddBuiltin (&sv_pr_state, "setmodel", PF_setmodel, 3); // void(entity e, string m) setmodel PR_AddBuiltin (&sv_pr_state, "setmodel", PF_setmodel, 3); // void (entity e, string m) setmodel
PR_AddBuiltin (&sv_pr_state, "setsize", PF_setsize, 4); // void (entity e, vector min, vector max) setsize PR_AddBuiltin (&sv_pr_state, "setsize", PF_setsize, 4); // void (entity e, vector min, vector max) setsize
PR_AddBuiltin (&sv_pr_state, "fixme", PF_Fixme, 5); // void (entity e, vector min, vector max) setabssize PR_AddBuiltin (&sv_pr_state, "fixme", PF_Fixme, 5); // void (entity e, vector min, vector max) setabssize
PR_AddBuiltin (&sv_pr_state, "sound", PF_sound, 8); // void (entity e, float chan, string samp) sound PR_AddBuiltin (&sv_pr_state, "sound", PF_sound, 8); // void (entity e, float chan, string samp) sound
@ -1873,13 +1873,13 @@ SV_PR_Cmds_Init ()
PR_AddBuiltin (&sv_pr_state, "WriteBytes", PF_WriteBytes, -1); // void (float to, ...) WriteBytes PR_AddBuiltin (&sv_pr_state, "WriteBytes", PF_WriteBytes, -1); // void (float to, ...) WriteBytes
PR_AddBuiltin (&sv_pr_state, "writechar", PF_WriteChar, 53); // void (float to, float f) WriteChar PR_AddBuiltin (&sv_pr_state, "writechar", PF_WriteChar, 53); // void (float to, float f) WriteChar
PR_AddBuiltin (&sv_pr_state, "writeshort", PF_WriteShort, 54); // void (float to, float f) WriteShort PR_AddBuiltin (&sv_pr_state, "writeshort", PF_WriteShort, 54); // void (float to, float f) WriteShort
PR_AddBuiltin (&sv_pr_state, "writelong", PF_WriteLong, 55); // void(float to, float f) WriteLong PR_AddBuiltin (&sv_pr_state, "writelong", PF_WriteLong, 55); // void (float to, float f) WriteLong
PR_AddBuiltin (&sv_pr_state, "writecoord", PF_WriteCoord, 56); // void(float to, float f) WriteCoord PR_AddBuiltin (&sv_pr_state, "writecoord", PF_WriteCoord, 56); // void (float to, float f) WriteCoord
PR_AddBuiltin (&sv_pr_state, "writeangle", PF_WriteAngle, 57); // void(float to, float f) WriteAngle PR_AddBuiltin (&sv_pr_state, "writeangle", PF_WriteAngle, 57); // void (float to, float f) WriteAngle
PR_AddBuiltin (&sv_pr_state, "WriteCoordV", PF_WriteCoordV, -1); // void(float to, vector v) WriteCoordV PR_AddBuiltin (&sv_pr_state, "WriteCoordV", PF_WriteCoordV, -1); // void (float to, vector v) WriteCoordV
PR_AddBuiltin (&sv_pr_state, "WriteAngleV", PF_WriteAngleV, -1); // void(float to, vector v) WriteAngleV PR_AddBuiltin (&sv_pr_state, "WriteAngleV", PF_WriteAngleV, -1); // void (float to, vector v) WriteAngleV
PR_AddBuiltin (&sv_pr_state, "writestring", PF_WriteString, 58); // void(float to, string s) WriteString PR_AddBuiltin (&sv_pr_state, "writestring", PF_WriteString, 58); // void (float to, string s) WriteString
PR_AddBuiltin (&sv_pr_state, "writeentity", PF_WriteEntity, 59); // void(float to, entity s) WriteEntity PR_AddBuiltin (&sv_pr_state, "writeentity", PF_WriteEntity, 59); // void (float to, entity s) WriteEntity
PR_AddBuiltin (&sv_pr_state, "movetogoal", SV_MoveToGoal, 67); // void (float step) movetogoal PR_AddBuiltin (&sv_pr_state, "movetogoal", SV_MoveToGoal, 67); // void (float step) movetogoal
PR_AddBuiltin (&sv_pr_state, "precache_file", PF_precache_file, 68); // string (string s) precache_file PR_AddBuiltin (&sv_pr_state, "precache_file", PF_precache_file, 68); // string (string s) precache_file
PR_AddBuiltin (&sv_pr_state, "makestatic", PF_makestatic, 69); // void (entity e) makestatic PR_AddBuiltin (&sv_pr_state, "makestatic", PF_makestatic, 69); // void (entity e) makestatic

View file

@ -416,11 +416,11 @@ SV_Multicast (const vec3_t origin, int to)
if (sv.demorecording) { if (sv.demorecording) {
if (reliable) { if (reliable) {
//DemoWrite_Begin(dem_multiple, cls, sv.multicast.cursize); // DemoWrite_Begin (dem_multiple, cls, sv.multicast.cursize);
DemoWrite_Begin(dem_all, 0, sv.multicast.cursize); DemoWrite_Begin (dem_all, 0, sv.multicast.cursize);
SZ_Write (&demo.dbuf->sz, sv.multicast.data, sv.multicast.cursize); SZ_Write (&demo.dbuf->sz, sv.multicast.data, sv.multicast.cursize);
} else } else
SZ_Write(&demo.datagram, sv.multicast.data, sv.multicast.cursize); SZ_Write (&demo.datagram, sv.multicast.data, sv.multicast.cursize);
} }
SZ_Clear (&sv.multicast); SZ_Clear (&sv.multicast);
@ -571,8 +571,8 @@ SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg)
// add this to server demo // add this to server demo
if (sv.demorecording && msg->cursize) { if (sv.demorecording && msg->cursize) {
DemoWrite_Begin(dem_single, clnum, msg->cursize); DemoWrite_Begin (dem_single, clnum, msg->cursize);
SZ_Write(&demo.dbuf->sz, msg->data, msg->cursize); SZ_Write (&demo.dbuf->sz, msg->data, msg->cursize);
} }
// a fixangle might get lost in a dropped packet. Oh well. // a fixangle might get lost in a dropped packet. Oh well.
@ -727,7 +727,7 @@ SV_UpdateToReliableMessages (void)
} }
if (sv.demorecording) { if (sv.demorecording) {
DemoWrite_Begin(dem_all, 0, 4); DemoWrite_Begin (dem_all, 0, 4);
MSG_WriteByte (&demo.dbuf->sz, svc_updatefrags); MSG_WriteByte (&demo.dbuf->sz, svc_updatefrags);
MSG_WriteByte (&demo.dbuf->sz, i); MSG_WriteByte (&demo.dbuf->sz, i);
MSG_WriteShort (&demo.dbuf->sz, MSG_WriteShort (&demo.dbuf->sz,
@ -786,7 +786,7 @@ SV_UpdateToReliableMessages (void)
sv.reliable_datagram.cursize); sv.reliable_datagram.cursize);
} }
if (sv.demorecording) if (sv.demorecording)
SZ_Write(&demo.datagram, sv.datagram.data, sv.datagram.cursize); // FIXME: ??? SZ_Write (&demo.datagram, sv.datagram.data, sv.datagram.cursize); // FIXME: ???
SZ_Clear (&sv.reliable_datagram); SZ_Clear (&sv.reliable_datagram);
SZ_Clear (&sv.datagram); SZ_Clear (&sv.datagram);
@ -884,7 +884,7 @@ SV_SendClientMessages (void)
} }
void void
SV_SendDemoMessage(void) SV_SendDemoMessage (void)
{ {
int i, j, cls = 0; int i, j, cls = 0;
client_t *c; client_t *c;
@ -909,12 +909,11 @@ SV_SendDemoMessage(void)
else else
min_fps = sv_demofps->value; min_fps = sv_demofps->value;
min_fps = max(4, min_fps); min_fps = max (4, min_fps);
if (sv.time - demo.time < 1.0 / min_fps) if (sv.time - demo.time < 1.0 / min_fps)
return; return;
for (i=0, c = svs.clients ; i<MAX_CLIENTS ; i++, c++) for (i = 0, c = svs.clients ; i<MAX_CLIENTS ; i++, c++) {
{
if (c->state != cs_spawned) if (c->state != cs_spawned)
continue; // datagrams only go to spawned continue; // datagrams only go to spawned
@ -927,12 +926,12 @@ SV_SendDemoMessage(void)
} }
msg.data = buf; msg.data = buf;
msg.maxsize = sizeof(buf); msg.maxsize = sizeof (buf);
msg.cursize = 0; msg.cursize = 0;
msg.allowoverflow = true; msg.allowoverflow = true;
msg.overflowed = false; msg.overflowed = false;
for (i=0, c = svs.clients; i < MAX_CLIENTS; i++, c++) { for (i = 0, c = svs.clients; i < MAX_CLIENTS; i++, c++) {
if (c->state != cs_spawned) if (c->state != cs_spawned)
continue; // datagrams only go to spawned continue; // datagrams only go to spawned
@ -941,19 +940,19 @@ SV_SendDemoMessage(void)
get_stats (c->edict, 0, stats); get_stats (c->edict, 0, stats);
for (j=0 ; j<MAX_CL_STATS ; j++) for (j = 0 ; j < MAX_CL_STATS ; j++)
if (stats[j] != demo.stats[i][j]) { if (stats[j] != demo.stats[i][j]) {
demo.stats[i][j] = stats[j]; demo.stats[i][j] = stats[j];
if (stats[j] >=0 && stats[j] <= 255) { if (stats[j] >=0 && stats[j] <= 255) {
DemoWrite_Begin(dem_stats, i, 3); DemoWrite_Begin (dem_stats, i, 3);
MSG_WriteByte(&demo.dbuf->sz, svc_updatestat); MSG_WriteByte (&demo.dbuf->sz, svc_updatestat);
MSG_WriteByte(&demo.dbuf->sz, j); MSG_WriteByte (&demo.dbuf->sz, j);
MSG_WriteByte(&demo.dbuf->sz, stats[j]); MSG_WriteByte (&demo.dbuf->sz, stats[j]);
} else { } else {
DemoWrite_Begin(dem_stats, i, 6); DemoWrite_Begin (dem_stats, i, 6);
MSG_WriteByte(&demo.dbuf->sz, svc_updatestatlong); MSG_WriteByte (&demo.dbuf->sz, svc_updatestatlong);
MSG_WriteByte(&demo.dbuf->sz, j); MSG_WriteByte (&demo.dbuf->sz, j);
MSG_WriteLong(&demo.dbuf->sz, stats[j]); MSG_WriteLong (&demo.dbuf->sz, stats[j]);
} }
} }
} }
@ -965,30 +964,31 @@ SV_SendDemoMessage(void)
if (!demo.recorder.delta_sequence) if (!demo.recorder.delta_sequence)
demo.recorder.delta_sequence = -1; demo.recorder.delta_sequence = -1;
SV_WriteEntitiesToClient (&demo.recorder, &msg, true); SV_WriteEntitiesToClient (&demo.recorder, &msg, true);
DemoWrite_Begin(dem_all, 0, msg.cursize); DemoWrite_Begin (dem_all, 0, msg.cursize);
SZ_Write (&demo.dbuf->sz, msg.data, msg.cursize); SZ_Write (&demo.dbuf->sz, msg.data, msg.cursize);
// copy the accumulated multicast datagram // copy the accumulated multicast datagram
// for this client out to the message // for this client out to the message
if (demo.datagram.cursize) { if (demo.datagram.cursize) {
DemoWrite_Begin(dem_all, 0, demo.datagram.cursize); DemoWrite_Begin (dem_all, 0, demo.datagram.cursize);
SZ_Write (&demo.dbuf->sz, demo.datagram.data, demo.datagram.cursize); SZ_Write (&demo.dbuf->sz, demo.datagram.data, demo.datagram.cursize);
SZ_Clear (&demo.datagram); SZ_Clear (&demo.datagram);
} }
demo.recorder.delta_sequence = demo.recorder.netchan.incoming_sequence&255; demo.recorder.delta_sequence =
demo.recorder.netchan.incoming_sequence & 255;
demo.recorder.netchan.incoming_sequence++; demo.recorder.netchan.incoming_sequence++;
demo.frames[demo.parsecount&DEMO_FRAMES_MASK].time = demo.time = sv.time; demo.frames[demo.parsecount & DEMO_FRAMES_MASK].time = demo.time = sv.time;
// that's a backup of 3sec in 20fps, should be enough // that's a backup of 3sec in 20fps, should be enough
if (demo.parsecount - demo.lastwritten > 60) { if (demo.parsecount - demo.lastwritten > 60) {
SV_DemoWritePackets(1); SV_DemoWritePackets (1);
} }
demo.parsecount++; demo.parsecount++;
DemoSetMsgBuf(demo.dbuf, DemoSetMsgBuf (demo.dbuf,
&demo.frames[demo.parsecount&DEMO_FRAMES_MASK].buf); &demo.frames[demo.parsecount & DEMO_FRAMES_MASK].buf);
if (sv_demoMaxSize->int_val && demo.size > sv_demoMaxSize->int_val*1024) if (sv_demoMaxSize->int_val && demo.size > sv_demoMaxSize->int_val * 1024)
SV_Stop (1); SV_Stop (1);
} }

View file

@ -65,7 +65,7 @@ info_t **svs_info = &svs.info;
#ifdef __alpha__ #ifdef __alpha__
static inline unsigned long static inline unsigned long
rdfpcr(void) rdfpcr (void)
{ {
unsigned long tmp, ret; unsigned long tmp, ret;
@ -89,7 +89,7 @@ rdfpcr(void)
} }
static inline void static inline void
wrfpcr(unsigned long val) wrfpcr (unsigned long val)
{ {
unsigned long tmp; unsigned long tmp;

View file

@ -171,7 +171,8 @@ SV_New_f (ucmd_t *cmd)
// Trigger GIB connection event // Trigger GIB connection event
if (sv_client_connect_e->func) if (sv_client_connect_e->func)
GIB_Event_Callback (sv_client_connect_e, 1, va("%u", host_client->userid)); GIB_Event_Callback (sv_client_connect_e, 1, va ("%u",
host_client->userid));
} }
static void static void
@ -294,7 +295,7 @@ SV_PreSpawn_f (ucmd_t *cmd)
// should be three numbers following containing checksums // should be three numbers following containing checksums
check = atoi (Cmd_Argv (3)); check = atoi (Cmd_Argv (3));
// Con_DPrintf("Client check = %d\n", check); // Con_DPrintf ("Client check = %d\n", check);
if (sv_mapcheck->int_val && check != sv.worldmodel->checksum && if (sv_mapcheck->int_val && check != sv.worldmodel->checksum &&
check != sv.worldmodel->checksum2) { check != sv.worldmodel->checksum2) {
@ -317,7 +318,7 @@ SV_PreSpawn_f (ucmd_t *cmd)
else else
command = va ("cmd prespawn %i %i\n", svs.spawncount, buf + 1); command = va ("cmd prespawn %i %i\n", svs.spawncount, buf + 1);
size = sv.signon_buffer_size[buf] + 1 + strlen(command) + 1; size = sv.signon_buffer_size[buf] + 1 + strlen (command) + 1;
ClientReliableCheckBlock (host_client, size); ClientReliableCheckBlock (host_client, size);
if (host_client->num_backbuf) if (host_client->num_backbuf)
@ -546,7 +547,8 @@ SV_Begin_f (ucmd_t *cmd)
// Trigger GIB events // Trigger GIB events
if (sv_client_spawn_e->func) if (sv_client_spawn_e->func)
GIB_Event_Callback (sv_client_spawn_e, 1, va("%u", host_client->userid)); GIB_Event_Callback (sv_client_spawn_e, 1, va ("%u",
host_client->userid));
} }
//============================================================================= //=============================================================================
@ -801,7 +803,7 @@ SV_Say (qboolean team)
host_client->whensaid[host_client->whensaidhead] = realtime; host_client->whensaid[host_client->whensaidhead] = realtime;
} }
p = Hunk_TempAlloc (strlen(Cmd_Args (1)) + 1); p = Hunk_TempAlloc (strlen (Cmd_Args (1)) + 1);
strcpy (p, Cmd_Args (1)); strcpy (p, Cmd_Args (1));
if (*p == '"') { if (*p == '"') {
@ -824,7 +826,8 @@ SV_Say (qboolean team)
} }
if (sv_chat_e->func) if (sv_chat_e->func)
GIB_Event_Callback (sv_chat_e, 2, va("%i", host_client->userid), p, type); GIB_Event_Callback (sv_chat_e, 2, va ("%i", host_client->userid), p,
type);
strncat (text, p, sizeof (text) - strlen (text)); strncat (text, p, sizeof (text) - strlen (text));
strncat (text, "\n", sizeof (text) - strlen (text)); strncat (text, "\n", sizeof (text) - strlen (text));

View file

@ -352,52 +352,52 @@ locs_loc (void)
mapname = malloc (sizeof (cl.worldmodel->name)); mapname = malloc (sizeof (cl.worldmodel->name));
if (!mapname) if (!mapname)
Sys_Error ("Can't duplicate mapname!"); Sys_Error ("Can't duplicate mapname!");
map_to_loc (cl.worldmodel->name,mapname); map_to_loc (cl.worldmodel->name, mapname);
snprintf (locfile, sizeof (locfile), "%s/%s/%s", fs_userpath->string, snprintf (locfile, sizeof (locfile), "%s/%s/%s", fs_userpath->string,
qfs_gamedir->dir.def, mapname); qfs_gamedir->dir.def, mapname);
free(mapname); free (mapname);
if (strcasecmp (Cmd_Argv(1),"save") == 0) { if (strcasecmp (Cmd_Argv (1), "save") == 0) {
if (Cmd_Argc () == 2) { if (Cmd_Argc () == 2) {
locs_save (locfile, false); locs_save (locfile, false);
} else } else
Con_Printf ("loc save :saves locs from memory into a .loc file\n"); Con_Printf ("loc save :saves locs from memory into a .loc file\n");
} }
if (strcasecmp (Cmd_Argv(1),"zsave") == 0) { if (strcasecmp (Cmd_Argv (1), "zsave") == 0) {
if (Cmd_Argc () == 2) { if (Cmd_Argc () == 2) {
locs_save (locfile, true); locs_save (locfile, true);
} else } else
Con_Printf ("loc save :saves locs from memory into a .loc file\n"); Con_Printf ("loc save :saves locs from memory into a .loc file\n");
} }
if (strcasecmp (Cmd_Argv(1),"add") == 0) { if (strcasecmp (Cmd_Argv (1), "add") == 0) {
if (Cmd_Argc () >= 3) if (Cmd_Argc () >= 3)
locs_mark (cl.simorg,desc); locs_mark (cl.simorg, desc);
else else
Con_Printf ("loc add <description> :marks the current location " Con_Printf ("loc add <description> :marks the current location "
"with the description and records the information " "with the description and records the information "
"into a loc file.\n"); "into a loc file.\n");
} }
if (strcasecmp (Cmd_Argv(1),"rename") == 0) { if (strcasecmp (Cmd_Argv (1), "rename") == 0) {
if (Cmd_Argc () >= 3) if (Cmd_Argc () >= 3)
locs_edit (cl.simorg,desc); locs_edit (cl.simorg, desc);
else else
Con_Printf ("loc rename <description> :changes the description of " Con_Printf ("loc rename <description> :changes the description of "
"the nearest location marker\n"); "the nearest location marker\n");
} }
if (strcasecmp (Cmd_Argv(1),"delete") == 0) { if (strcasecmp (Cmd_Argv (1),"delete") == 0) {
if (Cmd_Argc () == 2) if (Cmd_Argc () == 2)
locs_del (cl.simorg); locs_del (cl.simorg);
else else
Con_Printf ("loc delete :removes nearest location marker\n"); Con_Printf ("loc delete :removes nearest location marker\n");
} }
if (strcasecmp (Cmd_Argv(1),"move") == 0) { if (strcasecmp (Cmd_Argv (1),"move") == 0) {
if (Cmd_Argc () == 2) if (Cmd_Argc () == 2)
locs_edit (cl.simorg,NULL); locs_edit (cl.simorg, NULL);
else else
Con_Printf ("loc move :moves the nearest location marker to your " Con_Printf ("loc move :moves the nearest location marker to your "
"current location\n"); "current location\n");
@ -409,7 +409,7 @@ Locs_Loc_Get (void)
{ {
location_t *location; location_t *location;
if (GIB_Argc() != 1) if (GIB_Argc () != 1)
GIB_USAGE (""); GIB_USAGE ("");
else { else {
location = locs_find (cl.simorg); location = locs_find (cl.simorg);
@ -436,7 +436,7 @@ Team_F_Skins (char *args)
{ {
int totalfb, l; int totalfb, l;
while(isspace((byte) *args)) while (isspace ((byte) *args))
args++; args++;
for (l = 0; args[l] && !isspace ((byte) args[l]); l++); for (l = 0; args[l] && !isspace ((byte) args[l]); l++);
@ -469,8 +469,8 @@ Team_ParseChat (const char *string)
if (!cl_freply->value) if (!cl_freply->value)
return; return;
s = strchr(string, ':'); s = strchr (string, ':');
if (!(s = strchr(string, ':'))) if (!(s = strchr (string, ':')))
return; return;
s++; s++;
while (isspace ((byte) *s)) while (isspace ((byte) *s))