void Mod_Print (void);
+dfunction_t *ED_FindFunction (char *name);
+
/*
==================
Host_Quit_f
print = SV_ClientPrintf;
print ("host: %s\n", Cvar_VariableString ("hostname"));
- print ("version: %4.2f\n", VERSION);
+ print ("version: %4.2f (build %i)\n", VERSION, buildnumber);
if (tcpipAvailable)
print ("tcp/ip: %s\n", my_tcpip_address);
if (ipxAvailable)
for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
{
fscanf (f, "%s\n", str);
- sv.lightstyles[i] = Hunk_Alloc (strlen(str)+1);
+ sv.lightstyles[i] = Hunk_AllocName (strlen(str)+1, "lightstyles");
strcpy (sv.lightstyles[i], str);
}
void Host_Version_f (void)
{
- Con_Printf ("Version %4.2f\n", VERSION);
+ Con_Printf ("Version %4.2f (build %i)\n", VERSION, buildnumber);
Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
}
client_t *save;
int j;
char *p;
- char text[64];
+ char text[1024]; // LordHavoc: FIXME: temporary buffer overflow fix (was 64)
if (cmd_source == src_command)
{
{
int top, bottom;
int playercolor;
+ dfunction_t *f;
+ func_t SV_ChangeTeam;
if (Cmd_Argc() == 1)
{
return;
}
- host_client->colors = playercolor;
- host_client->edict->v.team = bottom + 1;
+ // void(float color) SV_ChangeTeam;
+ if ((f = ED_FindFunction ("SV_ChangeTeam")) && (SV_ChangeTeam = (func_t)(f - pr_functions)))
+ {
+ Con_DPrintf("Calling SV_ChangeTeam\n");
+ pr_global_struct->time = sv.time;
+ pr_globals[0] = playercolor;
+ pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
+ PR_ExecuteProgram (SV_ChangeTeam, "");
+ }
+ else
+ {
+ host_client->colors = playercolor;
+ host_client->edict->v.team = bottom + 1;
-// send notification to all clients
- MSG_WriteByte (&sv.reliable_datagram, svc_updatecolors);
- MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
- MSG_WriteByte (&sv.reliable_datagram, host_client->colors);
+ // send notification to all clients
+ MSG_WriteByte (&sv.reliable_datagram, svc_updatecolors);
+ MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
+ MSG_WriteByte (&sv.reliable_datagram, host_client->colors);
+ }
}
/*
if (sv_player->v.health <= 0)
{
- SV_ClientPrintf ("Can't suicide -- allready dead!\n");
+ SV_ClientPrintf ("Can't suicide -- already dead!\n");
return;
}
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(sv_player);
- PR_ExecuteProgram (pr_global_struct->ClientKill);
+ PR_ExecuteProgram (pr_global_struct->ClientKill, "QC function ClientKill is missing");
}
if (host_client->spawned)
{
- Con_Printf ("prespawn not valid -- allready spawned\n");
+ Con_Printf ("prespawn not valid -- already spawned\n");
return;
}
host_client->sendsignon = true;
}
-dfunction_t *ED_FindFunction (char *name);
-
/*
==================
Host_Spawn_f
if (host_client->spawned)
{
- Con_Printf ("Spawn not valid -- allready spawned\n");
+ Con_Printf ("Spawn not valid -- already spawned\n");
return;
}
+ // LordHavoc: moved this above the QC calls at FrikaC's request
+// send all current names, colors, and frag counts
+ SZ_Clear (&host_client->message);
+
// run the entrance script
if (sv.loadgame)
- { // loaded games are fully inited allready
+ { // loaded games are fully inited already
// if this is the last client to be connected, unpause
sv.paused = false;
Con_DPrintf("Calling RestoreGame\n");
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(sv_player);
- PR_ExecuteProgram (RestoreGame);
+ PR_ExecuteProgram (RestoreGame, "");
}
}
else
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(sv_player);
- PR_ExecuteProgram (pr_global_struct->ClientConnect);
+ PR_ExecuteProgram (pr_global_struct->ClientConnect, "QC function ClientConnect is missing");
if ((Sys_FloatTime() - host_client->netconnection->connecttime) <= sv.time)
Sys_Printf ("%s entered the game\n", host_client->name);
- PR_ExecuteProgram (pr_global_struct->PutClientInServer);
+ PR_ExecuteProgram (pr_global_struct->PutClientInServer, "QC function PutClientInServer is missing");
}
-// send all current names, colors, and frag counts
- SZ_Clear (&host_client->message);
-
// send time of update
MSG_WriteByte (&host_client->message, svc_time);
MSG_WriteFloat (&host_client->message, sv.time);
void PrintFrameName (model_t *m, int frame)
{
- aliashdr_t *hdr;
- maliasframedesc_t *pframedesc;
-
- hdr = (aliashdr_t *)Mod_Extradata (m);
- if (!hdr)
- return;
- pframedesc = &hdr->frames[frame];
-
- Con_Printf ("frame %i: %s\n", frame, pframedesc->name);
+ int data;
+ data = (int) Mod_Extradata(m);
+ if (m->ofs_scenes && data)
+ Con_Printf("frame %i: %s\n", frame, ((animscene_t *) (m->ofs_scenes + data))[frame].name);
+ else
+ Con_Printf("frame %i\n", frame);
}
/*