diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index ebd06b33c..5f76b9f52 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -171,6 +171,8 @@ CL_ClearState (void) memset (cl_baselines, 0, sizeof (cl_baselines)); memset (r_lightstyle, 0, sizeof (r_lightstyle)); + Skin_ClearTempSkins (); + CL_ClearTEnts (); R_ClearEfrags (); @@ -570,12 +572,6 @@ CL_RelinkEntities (void) } - if (i <= cl.maxclients) { - ent->skin = Skin_NewTempSkin (); - if (ent->skin) - CL_NewTranslation (i - 1, ent->skin); - } - // rotate binary objects locally if (ent->model->flags & EF_ROTATE) ent->angles[1] = bobjrotate; @@ -659,7 +655,6 @@ CL_ReadFromServer (void) Con_Printf ("\n"); R_ClearEnts (); - Skin_ClearTempSkins (); CL_RelinkEntities (); CL_UpdateTEnts (); diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index 0552b3a8c..292c998ab 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -44,6 +44,7 @@ static const char rcsid[] = #include "QF/msg.h" #include "QF/sys.h" #include "QF/screen.h" +#include "QF/skin.h" #include "QF/sound.h" // FIXME: DEFAULT_SOUND_PACKET_* #include "QF/input.h" @@ -394,8 +395,12 @@ CL_ParseUpdate (int bits) ent->syncbase = 0.0; } else forcelink = true; // hack to make null model players work - //XXX if (num > 0 && num <= cl.maxclients) - //XXX CL_NewTranslation (num - 1); + if (num > 0 && num <= cl.maxclients) { + if (!ent->skin) + ent->skin = Skin_NewTempSkin (); + if (ent->skin) + CL_NewTranslation (num - 1, ent->skin); + } } if (bits & U_FRAME) @@ -421,8 +426,12 @@ CL_ParseUpdate (int bits) skin = state->baseline.skin; if (skin != ent->skinnum) { ent->skinnum = skin; - //XXX if (num > 0 && num <= cl.maxclients) - //XXX CL_NewTranslation (num - 1); + if (num > 0 && num <= cl.maxclients) { + if (!ent->skin) + ent->skin = Skin_NewTempSkin (); + if (ent->skin) + CL_NewTranslation (num - 1, ent->skin); + } } if (bits & U_EFFECTS) @@ -786,11 +795,17 @@ CL_ParseServerMessage (void) case svc_updatecolors: Sbar_Changed (); i = MSG_ReadByte (net_message); - if (i >= cl.maxclients) + if (i >= cl.maxclients) { Host_Error ("CL_ParseServerMessage: svc_updatecolors > " "MAX_SCOREBOARD"); - cl.scores[i].colors = MSG_ReadByte (net_message); - //XXX CL_NewTranslation (i); + } else { + entity_t *ent = &cl_entities[i+1]; + cl.scores[i].colors = MSG_ReadByte (net_message); + if (!ent->skin) + ent->skin = Skin_NewTempSkin (); + if (ent->skin) + CL_NewTranslation (i, ent->skin); + } break; case svc_particle: