Caching models on startup instead of on infection. Probably fixes the freeze on infection problem.

This commit is contained in:
richard 2009-02-21 15:44:48 +01:00
parent 62ddc62e0e
commit ebb387d009
2 changed files with 1 additions and 7 deletions

View File

@ -71,6 +71,7 @@ LoadModelData()
Format(modelpath, sizeof(modelpath), "%s%s", model, modelSuffix[y]);
if (FileExists(modelpath))
{
PrecacheModel(modelpath);
AddFileToDownloadsTable(modelpath);
}
}
@ -136,4 +137,3 @@ ApplyZombieModel(client)
SetPlayerModel(client, modelpath);
}

View File

@ -198,13 +198,7 @@ TerminateRound(Float:delay, reason)
SetPlayerModel(client, const String:model[])
{
new log_debug = LogFlagCheck(LOG_DEBUG_DETAIL, LOG_MODULE_OFFSETS);
if (log_debug) ZR_LogMessageFormatted(-1, "offsets", "models", "Precaching model (\"%s\").", true, model);
PrecacheModel(model);
if (log_debug) ZR_LogMessageFormatted(-1, "offsets", "models", "Model cached.", true, model);
if (log_debug) ZR_LogMessageFormatted(-1, "offsets", "models", "Applying model (\"%s\") on client %d.", true, model, client);
SetEntityModel(client, model);
if (log_debug) ZR_LogMessageFormatted(-1, "offsets", "models", "Model applied on client %d.", true, model, client);
}
SetPlayerAlpha(client, alpha)