From e948de3d4161f3094d9985506770adc042e72d7d Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 23 Jun 2022 06:10:31 +0500 Subject: [PATCH] Add "Half-Life: Urbicide" support --- cl_dll/battery.cpp | 3 ++- cl_dll/health.cpp | 3 ++- cl_dll/hud.cpp | 13 +++++++++---- dlls/moddef.h | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cl_dll/battery.cpp b/cl_dll/battery.cpp index 7ae7e14c..ff0fb997 100644 --- a/cl_dll/battery.cpp +++ b/cl_dll/battery.cpp @@ -72,7 +72,8 @@ int CHudBattery::MsgFunc_Battery( const char *pszName, int iSize, void *pbuf ) int CHudBattery::Draw( float flTime ) { #ifdef MOBILE_HACKS - if( g_iModType == MOD_SEWER_BETA ) + if( g_iModType == MOD_SEWER_BETA + || g_iModType == MOD_URBICIDE ) return 1; #endif // MOBILE_HACKS if( gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH ) diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index 9c2bd526..c70d6dd6 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -238,7 +238,8 @@ int CHudHealth::Draw( float flTime ) int iWidth = HealthWidth / 10; #ifdef MOBILE_HACKS UnpackRGB( r, g, b, g_iHudColor ); - if( g_iModType != MOD_SEWER_BETA ) + if( !( g_iModType == MOD_SEWER_BETA + || g_iModType == MOD_URBICIDE ) ) #else // MOBILE_HACKS UnpackRGB( r, g, b, RGB_YELLOWISH ); #endif // MOBILE_HACKS diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index 0c78aef2..7519c0d3 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -410,10 +410,15 @@ void CHud::Init( void ) g_iHudColor = RGB_WHITISH; } else if( HUD_IsGame( "induction" ) ) - { - g_iModType = MOD_INDUCTION; - g_iHudColor = RGB_YELLOWISH; - } + { + g_iModType = MOD_INDUCTION; + g_iHudColor = RGB_YELLOWISH; + } + else if( HUD_IsGame( "hl_urbicide" ) ) + { + g_iModType = MOD_URBICIDE; + g_iHudColor = RGB_WHITISH; + } else { g_iModType = MOD_VALVE; diff --git a/dlls/moddef.h b/dlls/moddef.h index 2a2cebb1..f630ccad 100644 --- a/dlls/moddef.h +++ b/dlls/moddef.h @@ -15,7 +15,8 @@ enum MOD_INDUCTION, // Half-Life: Induction MOD_REDEMPT, // Redemption/Absolute Redemption MOD_SEWER_BETA, // Sewer Beta - MOD_TOT // Times of Troubles + MOD_TOT, // Times of Troubles + MOD_URBICIDE // Half-Life: Urbicide }; #endif // MODDEF