ddnet/src/game/client
bors[bot] 8d17670c67
Merge #6082
6082: Fix incorrect cursor position after exiting pause/spec r=def- a=Robyt3

The cursor position was not correctly restored when exiting pause or spec, when the mouse was on the left side of the tee (x being negative).

This is caused by a calculation introduced in #1637 and #1830 that tries to ensure that the mouse can still be moved if it ends up inside the minimum mouse distance (`cl_mouse_min_distance` and `cl_dyncam_min_distance`). However, this did not consider that the x position can become negative, so the x position was also incorrectly changed when exiting pause.

This is fixed by reverting the changes, as this code has become obsolete and has been superseded by #2009 and #3884. The `CControls::ClampMousePos` function, which is called directly after restoring the position, already ensures that mouse is not stuck within the minimum mouse distance.

Closes #2591.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [X] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [X] Changed no physics that affect existing maps
- [ ] 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: Robert Müller <robytemueller@gmail.com>
2022-12-03 22:39:20 +00:00
..
components Merge #6082 2022-12-03 22:39:20 +00:00
prediction Don't cast write parameter for FindEntities 2022-11-09 23:08:00 +01:00
animstate.cpp Organize game-client includes 2022-05-29 21:24:43 +02:00
animstate.h Remove unnecessary trailing semicolons after method declarations 2022-03-08 20:01:26 +01:00
component.cpp Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
component.h Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
gameclient.cpp Merge #5770 2022-11-01 10:29:53 +00:00
gameclient.h Add an option to remove weak hook & bounce 2022-07-21 17:04:16 +02:00
laser_data.cpp Add DDNetLaser to have more info about a laser shot 2022-09-15 01:01:32 +02:00
laser_data.h Add DDNetLaser to have more info about a laser shot 2022-09-15 01:01:32 +02:00
lineinput.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
lineinput.h m_DisplayStr -> m_aDisplayStr 2022-03-31 12:52:24 +02:00
projectile_data.cpp Constify snap more (inspired by upstream) 2022-10-09 15:12:12 +02:00
projectile_data.h force tunezone 2021-04-23 11:01:38 +08:00
race.cpp Organize game-client includes 2022-05-29 21:24:43 +02:00
race.h Organize game-client includes 2022-05-29 21:24:43 +02:00
render.cpp Fix misspellings 2022-10-25 13:51:56 -03:00
render.h Running and AFK anim. states 2022-09-16 12:30:05 +02:00
render_map.cpp Replace 3.14159265f with 'pi' from math.h 2022-07-09 19:19:21 +03:00
skin.h Get away from vector for skins 2022-10-12 22:32:36 +02:00
ui.cpp Add IInput::ShiftIsPressed and IInput::AltIsPressed 2022-11-15 21:17:55 +01:00
ui.h Port CUI::ConsumeHotkey from upstream 2022-08-31 21:43:57 +02:00
ui_rect.cpp Move CRenderTools::DrawUIRect/4 to CUIRect::Draw/4 2022-08-12 19:37:08 +02:00
ui_rect.h Move CRenderTools::DrawUIRect/4 to CUIRect::Draw/4 2022-08-12 19:37:08 +02:00
ui_scrollregion.cpp Add IInput::ShiftIsPressed and IInput::AltIsPressed 2022-11-15 21:17:55 +01:00
ui_scrollregion.h Port CScrollRegion from upstream with some minor refactorings 2022-08-23 10:01:28 +02:00