From ebb387d009d9e364c3ddd855816f3f88a872d3ea Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 21 Feb 2009 15:44:48 +0100 Subject: [PATCH] Caching models on startup instead of on infection. Probably fixes the freeze on infection problem. --- src/zr/models.inc | 2 +- src/zr/offsets.inc | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/zr/models.inc b/src/zr/models.inc index 631f865..011d305 100644 --- a/src/zr/models.inc +++ b/src/zr/models.inc @@ -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); } - diff --git a/src/zr/offsets.inc b/src/zr/offsets.inc index 901e995..73aa1dd 100644 --- a/src/zr/offsets.inc +++ b/src/zr/offsets.inc @@ -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)