From 7e5f4a974a92db29222f2b298377ae7074e6f0ef Mon Sep 17 00:00:00 2001 From: hzqst <113660872@qq.com> Date: Sun, 8 Dec 2024 10:36:27 +0800 Subject: [PATCH] Fixed an issue that ragdolls turned into static model in cstrike and czero. #515 --- Plugins/BulletPhysics/ClientEntityManager.cpp | 2 +- Plugins/BulletPhysics/privatehook.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Plugins/BulletPhysics/ClientEntityManager.cpp b/Plugins/BulletPhysics/ClientEntityManager.cpp index 334ea10c..5f2fe3ca 100644 --- a/Plugins/BulletPhysics/ClientEntityManager.cpp +++ b/Plugins/BulletPhysics/ClientEntityManager.cpp @@ -69,7 +69,7 @@ class CClientEntityManager : public IClientEntityManager if (IsEntityIndexTempEntity(entindex)) { - return &gTempEnts[entindex].entity; + return &gTempEnts[entindex - ENTINDEX_TEMPENTITY].entity; } return nullptr; diff --git a/Plugins/BulletPhysics/privatehook.cpp b/Plugins/BulletPhysics/privatehook.cpp index 30b33711..58ea8419 100644 --- a/Plugins/BulletPhysics/privatehook.cpp +++ b/Plugins/BulletPhysics/privatehook.cpp @@ -1440,8 +1440,6 @@ TEMPENTITY *efxapi_R_TempModel(float *pos, float *dir, float *angles, float life if (r && g_bIsCreatingClCorpse && g_iCreatingClCorpsePlayerIndex > 0 && g_iCreatingClCorpsePlayerIndex <= gEngfuncs.GetMaxClients()) { - int entindex = r - gTempEnts + ENTINDEX_TEMPENTITY; - r->entity.curstate.iuser4 = PhyCorpseFlag; r->entity.curstate.owner = g_iCreatingClCorpsePlayerIndex; }