Commit 19c22d75 authored by Dmitry Novikov's avatar Dmitry Novikov Committed by theAsmodai

Skipping local model to pre-cached if no entities to transmit. (#612)

* Skipping local model to pre-cached if no entities to transmit.
parent 2e2b9313
......@@ -265,6 +265,35 @@ char *ED_ParseEdict(char *data, edict_t *ent)
Q_strcpy(keyname, "angles");
}
#ifdef REHLDS_FIXES
else if (!Q_strcmp(keyname, "model"))
{
// local model?
if (com_token[0] == '*')
{
// find empty slot
int i;
for (i = 0; i < MAX_MODELS; i++)
{
if (!g_psv.model_precache[i])
break;
}
int index = Q_atoi(com_token + 1);
g_psv.model_precache[i] = localmodels[index];
g_psv.models[i] = Mod_ForName(localmodels[index], FALSE, FALSE);
g_psv.model_precache_flags[i] |= RES_FATALIFMISSING;
#ifdef REHLDS_OPT_PEDANTIC
{
int __itmp = i;
g_rehlds_sv.modelsMap.put(g_psv.model_precache[i], __itmp);
}
#endif
}
}
#endif
kvd.szClassName = className;
kvd.szKeyName = keyname;
......
......@@ -6043,7 +6043,6 @@ int SV_SpawnServer(qboolean bIsDemo, char *server, char *startspot)
g_psv.model_precache[0] = pr_strings;
#ifndef REHLDS_FIXES
g_psv.generic_precache[0] = pr_strings;
#endif // REHLDS_FIXES
for (i = 1; i < g_psv.worldmodel->numsubmodels; i++)
{
......@@ -6058,6 +6057,7 @@ int SV_SpawnServer(qboolean bIsDemo, char *server, char *startspot)
}
#endif
}
#endif // REHLDS_FIXES
Q_memset(&g_psv.edicts->v, 0, sizeof(entvars_t));
......@@ -7798,7 +7798,7 @@ void SV_Init(void)
Cvar_RegisterVariable(&sv_rehlds_attachedentities_playeranimationspeed_fix);
Cvar_RegisterVariable(&sv_rehlds_local_gametime);
Cvar_RegisterVariable(&sv_rehlds_send_mapcycle);
Cvar_RegisterVariable(&sv_rollspeed);
Cvar_RegisterVariable(&sv_rollangle);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment