From ced7d3c352233fe6ade99dd8734e643e6ca587ed Mon Sep 17 00:00:00 2001 From: zaCade Date: Mon, 13 Aug 2018 16:07:04 +0200 Subject: [PATCH] General: Dont apply model if not precached. --- src/zr/playerclasses/apply.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/zr/playerclasses/apply.inc b/src/zr/playerclasses/apply.inc index 978f1b5..23ef899 100644 --- a/src/zr/playerclasses/apply.inc +++ b/src/zr/playerclasses/apply.inc @@ -188,6 +188,13 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER) } } + // Check if the model is precached. + if (!IsModelPrecached(modelpath)) + { + LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Playerclasses, "Config Validation", "Warning: Model not precached, not applying model. \"%s\"", modelpath); + return true; + } + SetEntityModel(client, modelpath); SetEntProp(client, Prop_Send, "m_nSkin", skinIndex);