From 8f5c36dc62b463044cffa3ddf40347905ea39f08 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 8 Aug 2022 23:36:39 +0300 Subject: [PATCH 1/2] client: fix GoldSrc input being enabled for Android on x86 --- cl_dll/input_mouse.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cl_dll/input_mouse.h b/cl_dll/input_mouse.h index 0ecd8147..814e239f 100644 --- a/cl_dll/input_mouse.h +++ b/cl_dll/input_mouse.h @@ -1,4 +1,7 @@ #pragma once + +#include "build.h" + #if !defined(INPUT_MOUSE_H) #define INPUT_MOUSE_H #include "cl_dll.h" @@ -45,7 +48,7 @@ protected: }; // No need for goldsource input support on the platforms that are not supported by GoldSource. -#if GOLDSOURCE_SUPPORT && (_WIN32 || __linux__ || __APPLE__) && (__i386 || _M_IX86) +#if GOLDSOURCE_SUPPORT && ( XASH_WIN32 || ( XASH_LINUX && !XASH_ANDROID ) || XASH_APPLE ) && XASH_X86 #define SUPPORT_GOLDSOURCE_INPUT 1 #if _WIN32 From cd158fd18cf0c46b91096907ba017a912ff0faab Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 10 Aug 2022 00:27:39 +0300 Subject: [PATCH 2/2] Sooner WeaponIdle for M249 (match delay from opfor) (#318) --- cl_dll/hl/hl_weapons.cpp | 8 +------- dlls/gearbox/m249.cpp | 20 +++++++++++++++----- dlls/weapons.h | 2 ++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 38b97f62..8e570e65 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -1012,13 +1012,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm body = 1; if (pWeapon == &g_M249) { - if (g_M249.m_iVisibleClip == 0) { - body = 8; - } else if (g_M249.m_iVisibleClip > 0 && g_M249.m_iVisibleClip < 8) { - body = 9 - g_M249.m_iVisibleClip; - } else { - body = 0; - } + body = g_M249.BodyFromClip(); } // Force a fixed anim down to viewmodel diff --git a/dlls/gearbox/m249.cpp b/dlls/gearbox/m249.cpp index 18ed5fc4..553560cc 100644 --- a/dlls/gearbox/m249.cpp +++ b/dlls/gearbox/m249.cpp @@ -203,7 +203,7 @@ void CM249::PrimaryAttack() if (m_flNextPrimaryAttack < UTIL_WeaponTimeBase()) m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.2f; } @@ -282,13 +282,23 @@ void CM249::UpdateTape() } void CM249::UpdateTape(int clip) +{ + pev->body = BodyFromClip(clip); +} + +int CM249::BodyFromClip() +{ + return BodyFromClip(m_iVisibleClip); +} + +int CM249::BodyFromClip(int clip) { if (clip == 0) { - pev->body = 8; - } else if (m_iClip > 0 && clip < 8) { - pev->body = 9 - clip; + return 8; + } else if (clip > 0 && clip < 8) { + return 9 - clip; } else { - pev->body = 0; + return 0; } } diff --git a/dlls/weapons.h b/dlls/weapons.h index f09c904d..616d1d8f 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -1266,6 +1266,8 @@ public: void UpdateTape(); void UpdateTape(int clip); + int BodyFromClip(); + int BodyFromClip(int clip); int m_iVisibleClip;