mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #2980
2980: Fix laser prediction for non ddrace mods r=def- a=Jupeyy Correct me, if this is wrong, but only ddrace based mods cannot shot laser through itself. Tested on vanilla, ictf and fng(with antiping on and prediction on) Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
commit
75bdcce3ce
|
@ -30,12 +30,12 @@ bool CLaser::HitCharacter(vec2 From, vec2 To)
|
|||
vec2 At;
|
||||
CCharacter *pOwnerChar = GameWorld()->GetCharacterByID(m_Owner);
|
||||
CCharacter *pHit;
|
||||
bool pDontHitSelf = g_Config.m_SvOldLaser || (m_Bounces == 0 && !m_WasTele);
|
||||
bool DontHitSelf = (g_Config.m_SvOldLaser || !GameWorld()->m_WorldConfig.m_IsDDRace) || (m_Bounces == 0 && !m_WasTele);
|
||||
|
||||
if(pOwnerChar ? (!(pOwnerChar->m_Hit & CCharacter::DISABLE_HIT_LASER) && m_Type == WEAPON_LASER) || (!(pOwnerChar->m_Hit & CCharacter::DISABLE_HIT_SHOTGUN) && m_Type == WEAPON_SHOTGUN) : g_Config.m_SvHit)
|
||||
pHit = GameWorld()->IntersectCharacter(m_Pos, To, 0.f, At, pDontHitSelf ? pOwnerChar : 0, m_Owner);
|
||||
pHit = GameWorld()->IntersectCharacter(m_Pos, To, 0.f, At, DontHitSelf ? pOwnerChar : 0, m_Owner);
|
||||
else
|
||||
pHit = GameWorld()->IntersectCharacter(m_Pos, To, 0.f, At, pDontHitSelf ? pOwnerChar : 0, m_Owner, pOwnerChar);
|
||||
pHit = GameWorld()->IntersectCharacter(m_Pos, To, 0.f, At, DontHitSelf ? pOwnerChar : 0, m_Owner, pOwnerChar);
|
||||
|
||||
if(!pHit || (pHit == pOwnerChar && g_Config.m_SvOldLaser) || (pHit != pOwnerChar && pOwnerChar ? (pOwnerChar->m_Hit & CCharacter::DISABLE_HIT_LASER && m_Type == WEAPON_LASER) || (pOwnerChar->m_Hit & CCharacter::DISABLE_HIT_SHOTGUN && m_Type == WEAPON_SHOTGUN) : !g_Config.m_SvHit))
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue