mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
clamped information flow when moving as spectator in free-view. Closes #551
This commit is contained in:
parent
1ae474689d
commit
ab1f7d6f95
|
@ -60,6 +60,9 @@ void CPlayer::Tick()
|
|||
}
|
||||
}
|
||||
|
||||
if(!m_pCharacter && m_Team == TEAM_SPECTATORS && m_SpectatorID == SPEC_FREEVIEW)
|
||||
m_ViewPos -= vec2(clamp(m_ViewPos.x-m_LatestActivity.m_TargetX, -5000.0f, 500.0f), clamp(m_ViewPos.y-m_LatestActivity.m_TargetY, -400.0f, 400.0f));
|
||||
|
||||
if(!m_pCharacter && m_DieTick+Server()->TickSpeed()*3 <= Server()->Tick())
|
||||
m_Spawning = true;
|
||||
|
||||
|
@ -193,9 +196,6 @@ void CPlayer::OnDirectInput(CNetObj_PlayerInput *NewInput)
|
|||
if(!m_pCharacter && m_Team != TEAM_SPECTATORS && (NewInput->m_Fire&1))
|
||||
m_Spawning = true;
|
||||
|
||||
if(!m_pCharacter && m_Team == TEAM_SPECTATORS && m_SpectatorID == SPEC_FREEVIEW)
|
||||
m_ViewPos = vec2(NewInput->m_TargetX, NewInput->m_TargetY);
|
||||
|
||||
// check for activity
|
||||
if(NewInput->m_Direction || m_LatestActivity.m_TargetX != NewInput->m_TargetX ||
|
||||
m_LatestActivity.m_TargetY != NewInput->m_TargetY || NewInput->m_Jump ||
|
||||
|
|
Loading…
Reference in a new issue