return;
}
- sprintf (sv_loadgame, "%s/%s", fs_gamedir, Cmd_Argv(1));
+ strcpy (sv_loadgame, Cmd_Argv(1));
FS_DefaultExtension (sv_loadgame, ".sav");
Con_Printf ("Loading game from %s...\n", sv_loadgame);
// parse an edict
ent = EDICT_NUM(entnum);
memset (ent->v, 0, progs->entityfields * 4);
- ent->free = false;
+ ent->e->free = false;
ED_ParseEdict (start, ent);
// link it into the bsp tree
- if (!ent->free)
+ if (!ent->e->free)
SV_LinkEdict (ent, false);
}
if (strcmp(host_client->name, newName) != 0)
Con_Printf ("%s renamed to %s\n", host_client->name, newName);
strcpy (host_client->name, newName);
- host_client->edict->v->netname = PR_SetString(host_client->name);
+ sv_player->v->netname = PR_SetString(host_client->name);
// send notification to all clients
Con_DPrintf("Calling SV_ChangeTeam\n");
pr_global_struct->time = sv.time;
pr_globals[OFS_PARM0] = playercolor;
- pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
+ pr_global_struct->self = EDICT_TO_PROG(sv_player);
PR_ExecuteProgram (SV_ChangeTeam, "");
}
else
{
host_client->colors = playercolor;
- host_client->edict->v->team = bottom + 1;
+ sv_player->v->team = bottom + 1;
// send notification to all clients
MSG_WriteByte (&sv.reliable_datagram, svc_updatecolors);
}
pr_global_struct->time = sv.time;
- pr_global_struct->self = EDICT_TO_PROG(sv_player);
+ pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
PR_ExecuteProgram (pr_global_struct->ClientKill, "QC function ClientKill is missing");
}
// send all current names, colors, and frag counts
SZ_Clear (&host_client->message);
+ ent = sv_player;
+
// run the entrance script
if (sv.loadgame)
{
{
eval_t *val;
// set up the edict
- ent = host_client->edict;
-
- memset (ent->v, 0, progs->entityfields * 4);
+ ED_ClearEdict(ent);
ent->v->colormap = NUM_FOR_EDICT(ent);
ent->v->team = (host_client->colors & 15) + 1;
ent->v->netname = PR_SetString(host_client->name);
- if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_pmodel)))
+ if ((val = GETEDICTFIELDVALUE(ent, eval_pmodel)))
val->_float = host_client->pmodel;
// copy spawn parms out of the client_t
// in a state where it is expecting the client to correct the angle
// and it won't happen if the game was just loaded, so you wind up
// with a permanent head tilt
- ent = EDICT_NUM( 1 + (host_client - svs.clients) );
MSG_WriteByte (&host_client->message, svc_setangle);
for (i=0 ; i < 2 ; i++)
MSG_WriteAngle (&host_client->message, ent->v->angles[i] );