4232: Still clear pending mouse motion r=def- a=Jupeyy

Same as #3932 ... again :/

## 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
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] 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: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
bors[bot] 2021-10-19 21:30:32 +00:00 committed by GitHub
commit 4601f7500e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,6 +469,11 @@ int CInput::Update()
if(GetMouseMode() != INPUT_MOUSE_MODE_ABSOLUTE)
{
SDL_ShowCursor(SDL_FALSE);
if(SDL_GetRelativeMouseMode())
{
// Clear pending relative mouse motion
SDL_GetRelativeMouseState(0x0, 0x0);
}
}
m_MouseFocus = true;
IgnoreKeys = true;