From b16001bc1a5aee5e548b9d4e701e4c3296fa6604 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Mon, 10 May 2021 06:10:35 +0300 Subject: [PATCH 1/4] possible crash fix for DeathNotice --- dlls/multiplay_gamerules.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 5a4b14e0..137b3eeb 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -709,12 +709,12 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, const char *tau = "tau_cannon"; const char *gluon = "gluon gun"; - if( pKiller->flags & FL_CLIENT ) + if( pevInflictor ) { - killer_index = ENTINDEX( ENT( pKiller ) ); - - if( pevInflictor ) + if( pKiller->flags & FL_CLIENT ) { + killer_index = ENTINDEX( ENT( pKiller ) ); + if( pevInflictor == pKiller ) { // If the inflictor is the killer, then it must be their current weapon doing the damage @@ -730,10 +730,10 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, killer_weapon_name = STRING( pevInflictor->classname ); // it's just that easy } } - } - else - { - killer_weapon_name = STRING( pevInflictor->classname ); + else + { + killer_weapon_name = STRING( pevInflictor->classname ); + } } // strip the monster_* or weapon_* from the inflictor's classname From de65256d866bb58459681c7e8425db07bbef870d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Wed, 26 May 2021 23:13:43 +0600 Subject: [PATCH 2/4] cmake: fix build Fix the error: Unknown CMake command "elif" --- cmake/LibraryNaming.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index f4e3d4b0..26866447 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -92,7 +92,7 @@ endif() if(BUILDOS STREQUAL "android") set(POSTFIX "") # force disable for Android, as Android ports aren't distributed in normal way and doesn't follow library naming -elif(BUILDOS AND BUILDARCH) +elseif(BUILDOS AND BUILDARCH) set(POSTFIX "_${BUILDOS}_${BUILDARCH}") elseif(BUILDARCH) set(POSTFIX "_${BUILDARCH}") From e4dd9192cc9cdbc3737c46b11c3fac42dda5ffee Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 1 Jun 2021 17:38:24 +0300 Subject: [PATCH 3/4] client: fix scoreboard not setting IN_SCORE bit in usercmd --- cl_dll/input.cpp | 6 ++++++ cl_dll/scoreboard.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cl_dll/input.cpp b/cl_dll/input.cpp index eab15acf..76659a94 100644 --- a/cl_dll/input.cpp +++ b/cl_dll/input.cpp @@ -645,11 +645,13 @@ void IN_Impulse( void ) void IN_ScoreDown( void ) { KeyDown( &in_score ); + gHUD.m_Scoreboard.UserCmd_ShowScores(); } void IN_ScoreUp( void ) { KeyUp( &in_score ); + gHUD.m_Scoreboard.UserCmd_HideScores(); } void IN_MLookUp( void ) @@ -1082,6 +1084,10 @@ void InitInput( void ) gEngfuncs.pfnAddCommand( "-reload", IN_ReloadUp ); gEngfuncs.pfnAddCommand( "+alt1", IN_Alt1Down ); gEngfuncs.pfnAddCommand( "-alt1", IN_Alt1Up ); + gEngfuncs.pfnAddCommand( "+score", IN_ScoreDown ); + gEngfuncs.pfnAddCommand( "-score", IN_ScoreUp ); + gEngfuncs.pfnAddCommand( "+showscores", IN_ScoreDown ); + gEngfuncs.pfnAddCommand( "-showscores", IN_ScoreUp ); gEngfuncs.pfnAddCommand( "+graph", IN_GraphDown ); gEngfuncs.pfnAddCommand( "-graph", IN_GraphUp ); gEngfuncs.pfnAddCommand( "+break", IN_BreakDown ); diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index 721980f3..b5b2ae31 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -51,8 +51,8 @@ int CHudScoreboard::Init( void ) gHUD.AddHudElem( this ); // Hook messages & commands here - HOOK_COMMAND( "+showscores", ShowScores ); - HOOK_COMMAND( "-showscores", HideScores ); + // HOOK_COMMAND( "+showscores", ShowScores ); + // HOOK_COMMAND( "-showscores", HideScores ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); From 7fdc58743d1c3a4de6489232a233cf6f3a1b7a28 Mon Sep 17 00:00:00 2001 From: exstrim401 Date: Sat, 5 Jun 2021 12:48:51 +0500 Subject: [PATCH 4/4] Haiku OS support (#170) * Haiku OS support * Add Haiku OS to CMake LibraryNaming --- cmake/LibraryNaming.cmake | 3 +++ public/build.h | 4 ++++ scripts/waifulib/library_naming.py | 3 +++ 3 files changed, 10 insertions(+) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 26866447..db50422e 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -29,6 +29,7 @@ check_symbol_exists(XASH_MOBILE_PLATFORM "build.h" XASH_MOBILE_PLATFORM) check_symbol_exists(XASH_MSVC "build.h" XASH_MSVC) check_symbol_exists(XASH_NETBSD "build.h" XASH_NETBSD) check_symbol_exists(XASH_OPENBSD "build.h" XASH_OPENBSD) +check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU) check_symbol_exists(XASH_WIN32 "build.h" XASH_WIN32) check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64) check_symbol_exists(XASH_X86 "build.h" XASH_X86) @@ -45,6 +46,8 @@ elseif(XASH_NETBSD) set(BUILDOS "netbsd") elseif(XASH_OPENBSD) set(BUILDOS "openbsd") +elseif(XASH_HAIKU) + set(BUILDOS "haiku") elseif(XASH_EMSCRIPTEN) set(BUILDOS "emscripten") else() diff --git a/public/build.h b/public/build.h index 043a11cd..e23265ce 100644 --- a/public/build.h +++ b/public/build.h @@ -67,6 +67,7 @@ For more information, please refer to #undef XASH_MSVC #undef XASH_NETBSD #undef XASH_OPENBSD +#undef XASH_HAIKU #undef XASH_WIN32 #undef XASH_WIN64 #undef XASH_X86 @@ -115,6 +116,9 @@ For more information, please refer to #elif defined __WATCOMC__ && defined __DOS__ #define XASH_DOS4GW 1 #define XASH_LITTLE_ENDIAN +#elif defined __HAIKU__ + #define XASH_HAIKU 1 + #define XASH_POSIX 1 #else #error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug" #endif diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 6ee9a725..baf2ee71 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -47,6 +47,7 @@ DEFINES = [ 'XASH_MSVC', 'XASH_NETBSD', 'XASH_OPENBSD', +'XASH_HAIKU', 'XASH_WIN32', 'XASH_WIN64', 'XASH_X86', @@ -79,6 +80,8 @@ def configure(conf): buildos = "emscripten" elif conf.env.XASH_DOS4GW: buildos = "dos4gw" # unused, just in case + elif conf.env.XASH_HAIKU: + buildos = "haiku" else: conf.fatal("Place your operating system name in build.h and library_naming.py!\n" "If this is a mistake, try to fix conditions above and report a bug")