diff --git a/src/game/client/components/items.cpp b/src/game/client/components/items.cpp index cd6b32182..729d64d2d 100644 --- a/src/game/client/components/items.cpp +++ b/src/game/client/components/items.cpp @@ -329,7 +329,7 @@ void CItems::OnRender() && (pProj->GetOwner() < 0 || !GameClient()->m_aClients[pProj->GetOwner()].m_IsPredictedLocal) // skip locally predicted projectiles && !Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID)) { - ReconstructSmokeTrail((const CNetObj_Projectile *)pData, Item.m_ID, pProj->m_DestroyTick, pProj->m_LifeSpan); + ReconstructSmokeTrail((const CNetObj_Projectile *)pData, Item.m_ID, pProj->m_DestroyTick); } pProj->m_LastRenderTick = Client()->GameTick(g_Config.m_ClDummy); continue; @@ -442,7 +442,7 @@ void CItems::AddExtraProjectile(CNetObj_Projectile *pProj) } } -void CItems::ReconstructSmokeTrail(const CNetObj_Projectile *pCurrent, int ItemID, int DestroyTick, int LifeSpan) +void CItems::ReconstructSmokeTrail(const CNetObj_Projectile *pCurrent, int ItemID, int DestroyTick) { bool LocalPlayerInGame = false; @@ -495,7 +495,6 @@ void CItems::ReconstructSmokeTrail(const CNetObj_Projectile *pCurrent, int ItemI float T = Pt; if(DestroyTick >= 0) T = minimum(Pt, ((float)(DestroyTick - 1 - pCurrent->m_StartTick) + Client()->PredIntraGameTick(g_Config.m_ClDummy))/(float)SERVER_TICK_SPEED); - T = minimum(T, LifeSpan/(float)SERVER_TICK_SPEED); float MinTrailSpan = 0.4f * ((pCurrent->m_Type == WEAPON_GRENADE) ? 0.5f : 0.25f); float Step = maximum(Client()->FrameTimeAvg(), (pCurrent->m_Type == WEAPON_GRENADE) ? 0.02f : 0.01f); diff --git a/src/game/client/components/items.h b/src/game/client/components/items.h index b45478f73..c05aec8f4 100644 --- a/src/game/client/components/items.h +++ b/src/game/client/components/items.h @@ -27,7 +27,7 @@ public: void AddExtraProjectile(CNetObj_Projectile *pProj); - void ReconstructSmokeTrail(const CNetObj_Projectile *pCurrent, int ItemID, int DestroyTick, int LifeSpan); + void ReconstructSmokeTrail(const CNetObj_Projectile *pCurrent, int ItemID, int DestroyTick); }; #endif diff --git a/src/game/client/prediction/gameworld.cpp b/src/game/client/prediction/gameworld.cpp index 077a50a66..d85023e09 100644 --- a/src/game/client/prediction/gameworld.cpp +++ b/src/game/client/prediction/gameworld.cpp @@ -156,11 +156,10 @@ void CGameWorld::RemoveEntity(CEntity *pEnt) m_Core.m_apCharacters[ID] = 0; } } - pEnt->m_pParent = 0; - if(m_IsValidCopy && m_pParent && m_pParent->m_pChild == this) - if(pEnt->m_pParent) - pEnt->m_pParent->m_DestroyTick = GameTick(); + if(m_IsValidCopy && m_pParent && m_pParent->m_pChild == this && pEnt->m_pParent) + pEnt->m_pParent->m_DestroyTick = GameTick(); + pEnt->m_pParent = 0; } void CGameWorld::RemoveEntities()