void Mod_Print (void);
+dfunction_t *ED_FindFunction (char *name);
+
/*
==================
Host_Quit_f
{
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);
+ }
}
/*
host_client->sendsignon = true;
}
-dfunction_t *ED_FindFunction (char *name);
-
/*
==================
Host_Spawn_f