mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix bullet rendered through walls
This commit is contained in:
parent
dd9eb0d736
commit
b391e4b50d
|
@ -377,20 +377,17 @@ void CItems::OnRender()
|
|||
{
|
||||
if(auto *pProj = (CProjectile *)GameClient()->m_GameWorld.FindMatch(Item.m_ID, Item.m_Type, pData))
|
||||
{
|
||||
if(pProj->GetOwner() >= 0)
|
||||
bool IsOtherTeam = m_pClient->IsOtherTeam(pProj->GetOwner());
|
||||
if(pProj->m_LastRenderTick <= 0 && (pProj->m_Type != WEAPON_SHOTGUN || (!pProj->m_Freeze && !pProj->m_Explosive)) // skip ddrace shotgun bullets
|
||||
&& (pProj->m_Type == WEAPON_SHOTGUN || fabs(length(pProj->m_Direction) - 1.f) < 0.02) // workaround to skip grenades on ball mod
|
||||
&& (pProj->GetOwner() < 0 || !GameClient()->m_aClients[pProj->GetOwner()].m_IsPredictedLocal || IsOtherTeam) // skip locally predicted projectiles
|
||||
&& !Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID))
|
||||
{
|
||||
bool IsOtherTeam = m_pClient->IsOtherTeam(pProj->GetOwner());
|
||||
if(pProj->m_LastRenderTick <= 0 && (pProj->m_Type != WEAPON_SHOTGUN || (!pProj->m_Freeze && !pProj->m_Explosive)) // skip ddrace shotgun bullets
|
||||
&& (pProj->m_Type == WEAPON_SHOTGUN || fabs(length(pProj->m_Direction) - 1.f) < 0.02) // workaround to skip grenades on ball mod
|
||||
&& (pProj->GetOwner() < 0 || !GameClient()->m_aClients[pProj->GetOwner()].m_IsPredictedLocal || IsOtherTeam) // skip locally predicted projectiles
|
||||
&& !Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID))
|
||||
{
|
||||
ReconstructSmokeTrail(&Data, pProj->m_DestroyTick);
|
||||
}
|
||||
pProj->m_LastRenderTick = Client()->GameTick(g_Config.m_ClDummy);
|
||||
if(!IsOtherTeam)
|
||||
continue;
|
||||
ReconstructSmokeTrail(&Data, pProj->m_DestroyTick);
|
||||
}
|
||||
pProj->m_LastRenderTick = Client()->GameTick(g_Config.m_ClDummy);
|
||||
if(!IsOtherTeam)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(Inactive && (Data.m_Explosive ? BlinkingProjEx : BlinkingProj))
|
||||
|
|
Loading…
Reference in a new issue