Skip to content

Commit 453e1f5

Browse files
committed
Merge branch 'a1batross-patch-1'
2 parents 9552a3c + 3463b7f commit 453e1f5

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Link Linux binaries with `-Wl` and `--no-undefined` flags to avoid situations where something was referenced but wasn't added in the build (Thanks a1batross)
1111
* Prevented game_zone_player from transitioning across levels to fix Mod_NumForName: not found issue [#241](https://github.com/twhl-community/halflife-updated/pull/241) (Thanks FreeSlave)
1212
* Fixed null dereference in game_score [#246](https://github.com/twhl-community/halflife-updated/pull/246) (Thanks FreeSlave)
13+
* Fixed null dereference of m_rawinput and mouse issues on Linux [#251](https://github.com/twhl-community/halflife-updated/pull/251) (Thanks a1batross)
1314

1415
### Features
1516

FULL_UPDATED_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ Fixes for bugs introduced in beta builds are not included in this list.
296296
* Added missing client side event for `func_vehicle` sounds
297297
* Prevented game_zone_player from transitioning across levels to fix Mod_NumForName: not found issue [#241](https://github.com/twhl-community/halflife-updated/pull/241) (Thanks FreeSlave)
298298
* Fixed null dereference in game_score [#246](https://github.com/twhl-community/halflife-updated/pull/246) (Thanks FreeSlave)
299+
* Fixed null dereference of m_rawinput and mouse issues on Linux [#251](https://github.com/twhl-community/halflife-updated/pull/251) (Thanks a1batross)
299300

300301
## Code cleanup
301302

cl_dll/inputw32.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ static cvar_t* m_rawinput = nullptr;
6767

6868
static bool IN_UseRawInput()
6969
{
70-
return m_rawinput->value != 0;
70+
// a1ba: m_rawinput 1 is SDL input on Windows
71+
// Linux only has SDL input, so return true here
72+
return m_rawinput ? m_rawinput->value != 0 : true;
7173
}
7274

7375
static SDL_bool mouseRelative = SDL_TRUE;
@@ -268,11 +270,7 @@ void DLLEXPORT IN_ActivateMouse()
268270
mouseactive = true;
269271
}
270272

271-
if (g_iVisibleMouse
272-
#ifdef WIN32
273-
|| !IN_UseRawInput()
274-
#endif
275-
)
273+
if (g_iVisibleMouse || !IN_UseRawInput())
276274
{
277275
IN_SetMouseRelative(false);
278276
}
@@ -635,7 +633,6 @@ void IN_MouseMove(float frametime, usercmd_t* cmd)
635633

636634
gEngfuncs.SetViewAngles((float*)viewangles);
637635

638-
#ifdef WIN32
639636
if ((!IN_UseRawInput() && SDL_FALSE != mouseRelative) || g_iVisibleMouse)
640637
{
641638
IN_SetMouseRelative(false);
@@ -644,7 +641,6 @@ void IN_MouseMove(float frametime, usercmd_t* cmd)
644641
{
645642
IN_SetMouseRelative(true);
646643
}
647-
#endif
648644

649645
/*
650646
//#define TRACE_TEST

0 commit comments

Comments
 (0)