mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Merge #5218
5218: do not snap dragger beam, if the target is out of reach r=def- a=C0D3D3V fixes #5216 ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
This commit is contained in:
commit
ac15943e85
|
@ -87,7 +87,7 @@ void CDraggerBeam::Snap(int SnappingClient)
|
||||||
}
|
}
|
||||||
// Only players with the dragger beam in their field of view or who want to see everything will receive the snap
|
// Only players with the dragger beam in their field of view or who want to see everything will receive the snap
|
||||||
vec2 TargetPos = vec2(pTarget->m_Pos.x, pTarget->m_Pos.y);
|
vec2 TargetPos = vec2(pTarget->m_Pos.x, pTarget->m_Pos.y);
|
||||||
if(NetworkClippedLine(SnappingClient, m_Pos, TargetPos))
|
if(distance(pTarget->m_Pos, m_Pos) >= g_Config.m_SvDraggerRange || NetworkClippedLine(SnappingClient, m_Pos, TargetPos))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue