print a warning and recover instead of crashing when the model is null

This commit is contained in:
Bill Currie 2001-12-02 00:38:44 +00:00
parent 5b13c1a07d
commit 27ff29214e

View file

@ -522,9 +522,12 @@ CL_LinkPacketEntities (void)
model = (*ent)->model; model = (*ent)->model;
if (!model) if (!model) {
Host_Error ("null model: %d %s\n", s1->number, Con_Printf ("WARNING: null model: %d %s\n", s1->number,
cl.model_precache[s1->modelindex]->name); cl.model_precache[s1->modelindex]->name);
model = (*ent)->model = cl.model_precache[s1->modelindex];
cl_entity_model_states[s1->number].model = model;
}
if (model->flags & EF_ROTATE) { // rotate binary objects locally if (model->flags & EF_ROTATE) { // rotate binary objects locally
(*ent)->angles[0] = 0; (*ent)->angles[0] = 0;