From 53faac8eaded503ae35d709a1213f9bce81387cc Mon Sep 17 00:00:00 2001 From: WPMGPRoSToTeMa Date: Fri, 5 Feb 2016 23:03:26 +0300 Subject: [PATCH] Fixed segroup precache for models with 1 seqgroup (some that models have garbage in first seqgroup, first seqgroup is also reserved for sequences in model) --- rehlds/engine/pr_cmds.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rehlds/engine/pr_cmds.cpp b/rehlds/engine/pr_cmds.cpp index db2e8cb..c4aac0d 100644 --- a/rehlds/engine/pr_cmds.cpp +++ b/rehlds/engine/pr_cmds.cpp @@ -1473,10 +1473,12 @@ int EXT_FUNC PF_precache_model_I(const char *s) PF_precache_model_I(textureModelName); } - if (pStudioHeader->numseqgroups) + // 0 seqgroup is reserved for sequences in this model + if (pStudioHeader->numseqgroups > 1) { mstudioseqgroup_t *pSeqGroup = (mstudioseqgroup_t *)((uint8_t *)pStudioHeader + pStudioHeader->seqgroupindex); - for (int i = 0; i < pStudioHeader->numseqgroups; i++, pSeqGroup++) + ++pSeqGroup; + for (int i = 1; i < pStudioHeader->numseqgroups; i++, pSeqGroup++) { if (pSeqGroup->name[0] == '\0') continue;