Fix null reference exception.
Occurred when using relative mouse mode without a focused window.
This commit is contained in:
parent
721ac5f4d8
commit
0da1c5b3ae
1 changed files with 1 additions and 1 deletions
|
@ -323,7 +323,7 @@ SDL_SetRelativeMouseMode(SDL_bool enabled)
|
||||||
/* Set the relative mode */
|
/* Set the relative mode */
|
||||||
mouse->relative_mode = enabled;
|
mouse->relative_mode = enabled;
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled && mouse->focus) {
|
||||||
/* Restore the expected mouse position */
|
/* Restore the expected mouse position */
|
||||||
SDL_WarpMouseInWindow(mouse->focus, mouse->x, mouse->y);
|
SDL_WarpMouseInWindow(mouse->focus, mouse->x, mouse->y);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue