return;
}
FS_StripExtension(sv.worldmodel->name, basename, sizeof(basename));
- FS_WriteFile(va("%s.ent", basename), sv.worldmodel->brush.entities, strlen(sv.worldmodel->brush.entities));
+ FS_WriteFile(va("%s.ent", basename), sv.worldmodel->brush.entities, (fs_offset_t)strlen(sv.worldmodel->brush.entities));
}
for (e = 1, ent = PRVM_NEXT_EDICT(prog->edicts);e < prog->num_edicts;e++, ent = PRVM_NEXT_EDICT(ent))
{
sendentitiesindex[e] = NULL;
- if (ent->priv.server->free)
+ // the 2 billion unit check is actually to detect NAN origins (we really don't want to send those)
+ if (ent->priv.server->free || VectorLength2(ent->fields.server->origin) > 2000000000.0*2000000000.0)
continue;
cs = defaultstate;
memset (&sv, 0, sizeof(sv));
+ sv.active = true;
+
strlcpy (sv.name, server, sizeof (sv.name));
sv.protocol = Protocol_EnumForName(sv_protocolname.string);
//prog->num_edicts = svs.maxclients+1;
sv.state = ss_loading;
+ prog->allowworldwrites = true;
sv.paused = false;
*prog->time = sv.time = 1.0;
// LordHavoc: clear world angles (to fix e3m3.bsp)
VectorClear(prog->edicts->fields.server->angles);
- sv.active = true;
-
// all setup is completed, any further precache statements are errors
sv.state = ss_active;
+ prog->allowworldwrites = false;
// run two frames to allow everything to settle
for (i = 0;i < 2;i++)
e->fields.server->colormap = num + 1;
e->fields.server->team = (svs.clients[num].colors & 15) + 1;
// set netname/clientcolors back to client values so that
- // DP_SV_CLIENTNAME and DPV_SV_CLIENTCOLORS will not immediately
+ // DP_SV_CLIENTNAME and DP_SV_CLIENTCOLORS will not immediately
// reset them
e->fields.server->netname = PRVM_SetEngineString(svs.clients[num].name);
if ((val = PRVM_GETEDICTFIELDVALUE(e, eval_clientcolors)))