// call qc ClientDisconnect function
// LordHavoc: don't call QC if server is dead (avoids recursive
// Host_Error in some mods when they run out of edicts)
- if (host_client->active && sv.active && host_client->edict && host_client->spawned)
+ if (host_client->clientconnectcalled && sv.active && host_client->edict)
{
// call the prog function for removing a client
// this will set the body to a dead frame, among other things
int saveSelf = pr_global_struct->self;
+ host_client->clientconnectcalled = false;
pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
PR_ExecuteProgram(pr_global_struct->ClientDisconnect, "QC function ClientDisconnect is missing");
pr_global_struct->self = saveSelf;
(&pr_global_struct->parm1)[i] = host_client->spawn_parms[i];
// call the spawn function
+ host_client->clientconnectcalled = true;
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
PR_ExecuteProgram (pr_global_struct->ClientConnect, "QC function ClientConnect is missing");
{
// false = empty client slot
qboolean active;
+ // false = don't do ClientDisconnect on drop
+ qboolean clientconnectcalled;
// false = don't send datagrams
qboolean spawned;
// has been told to go to another level
(&pr_global_struct->parm1)[i] = host_client->spawn_parms[i];
// call the spawn function
+ host_client->clientconnectcalled = true;
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(client->edict);
PR_ExecuteProgram (pr_global_struct->ClientConnect, "QC function ClientConnect is missing");