From 3dfd9dc059a8c593dbb2c990453262260e245717 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 2 Jan 2025 20:49:06 +0300 Subject: [PATCH 01/11] Fix poison time-based damage effect getting removed on reloading/transitioning. Fix #347 (#502) --- dlls/player.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index 21b636b24..05bf7589c 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3026,7 +3026,6 @@ void CBasePlayer::Precache( void ) m_flgeigerRange = 1000; m_igeigerRangePrev = 1000; - m_bitsDamageType = 0; m_bitsHUDDamage = -1; m_iClientBattery = -1; From 1a4d59fa743170179ffa8f7bb400725af06fa150 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 2 Jan 2025 20:49:18 +0300 Subject: [PATCH 02/11] Fix wrong spray decal being used on save-restore if tempdecal.wad doesn't exist. Fix #239 (#503) --- dlls/player.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/player.cpp b/dlls/player.cpp index 05bf7589c..ffa64ca61 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3039,6 +3039,8 @@ void CBasePlayer::Precache( void ) m_iUpdateTime = 5; // won't update for 1/2 a second + m_nCustomSprayFrames = -1; + if( gInitHUD ) m_fInitHUD = TRUE; From 75b38fcdfffaf5b0da1b56893a9825c6a4ea069b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 2 Jan 2025 20:49:31 +0300 Subject: [PATCH 03/11] Fix crowbar applying breakable glass decals to unbreakable pushable objects (#504) --- dlls/func_break.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index f1829d6ca..bc04c1c8b 100644 --- a/dlls/func_break.cpp +++ b/dlls/func_break.cpp @@ -792,6 +792,8 @@ class CPushable : public CBreakable // breakables use an overridden takedamage virtual int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ); + int DamageDecal(int bitsDamageType); + static TYPEDESCRIPTION m_SaveData[]; static const char *m_soundNames[3]; @@ -1044,3 +1046,11 @@ int CPushable::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, floa return 1; } + +int CPushable::DamageDecal(int bitsDamageType) +{ + if (FBitSet(pev->spawnflags, SF_PUSH_BREAKABLE)) + return CBreakable::DamageDecal(bitsDamageType); + + return CBaseEntity::DamageDecal(bitsDamageType); +} From e53009991a48cce8eea8bacc474ef886c4b70db5 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 3 Jan 2025 05:19:28 +0300 Subject: [PATCH 04/11] Floor taken damage for player instead casting to int. Avoid casting issues (#505) --- dlls/player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index ffa64ca61..cd72f9083 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -486,7 +486,7 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl // this cast to INT is critical!!! If a player ends up with 0.5 health, the engine will get that // as an int (zero) and think the player is dead! (this will incite a clientside screentilt, etc) - fTookDamage = CBaseMonster::TakeDamage( pevInflictor, pevAttacker, (int)flDamage, bitsDamageType ); + fTookDamage = CBaseMonster::TakeDamage( pevInflictor, pevAttacker, flDamage >= 0.0f ? floor(flDamage) : ceil(flDamage), bitsDamageType ); // reset damage time countdown for each type of time based damage player just sustained { From a816e954aef902c52f2ad295c0f10dac967f7363 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 10 Jan 2025 16:11:19 +0300 Subject: [PATCH 05/11] client: wscript: fix build with goldsrc support when no SDL2 is installed in the system --- cl_dll/wscript | 1 + 1 file changed, 1 insertion(+) diff --git a/cl_dll/wscript b/cl_dll/wscript index 847004272..7b824c9b5 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -99,6 +99,7 @@ def build(bld): if bld.env.GOLDSOURCE_SUPPORT: defines += ['GOLDSOURCE_SUPPORT'] + includes += ['../external/'] if bld.env.DEST_OS == 'win32': libs += ["WINMM"] From a9922d1c3ef0cc1920f4bff27237bfb6b02963d4 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 10 Jan 2025 21:45:13 +0300 Subject: [PATCH 06/11] wscript: build 32-bit DLLs with 64-bit MSVC for better build times --- wscript | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index a934c6259..e09072319 100644 --- a/wscript +++ b/wscript @@ -45,7 +45,12 @@ def options(opt): def configure(conf): conf.load('fwgslib reconfigure compiler_optimizations') - conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64'] + if conf.options.ALLOW64: + conf.env.MSVC_TARGETS = ['x64'] + elif sys.maxsize > 2 ** 32 and not conf.options.MSVC_WINE: + conf.env.MSVC_TARGETS = ['amd64_x86', 'x86'] + else: + conf.env.MSVC_TARGETS = ['x86'] # Load compilers early conf.load('xcompile compiler_c compiler_cxx gccdeps') From 8ad563dd4251185326520bd50b08a7b6d28b0ae5 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 10 Jan 2025 22:15:23 +0300 Subject: [PATCH 07/11] wscript: try to improve build times further by using /showIncludes but only if requested (currently only on CI as it's totally broken on non-English locales) --- wscript | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index e09072319..7a7ae7b5c 100644 --- a/wscript +++ b/wscript @@ -40,8 +40,10 @@ def options(opt): grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'USE_VOICEMGR', default = False, help = 'Enable VOICE MANAGER') - opt.add_subproject('dlls') - opt.add_subproject('cl_dll') + # a1ba: hidden option for CI + grp.add_option('--enable-msvcdeps', action='store_true', dest='MSVCDEPS', default=False, help='') + + opt.add_subproject('cl_dll dlls') def configure(conf): conf.load('fwgslib reconfigure compiler_optimizations') @@ -55,6 +57,9 @@ def configure(conf): # Load compilers early conf.load('xcompile compiler_c compiler_cxx gccdeps') + if conf.options.MSVCDEPS: + conf.load('msvcdeps') + # HACKHACK: override msvc DEST_CPU value by something that we understand if conf.env.DEST_CPU == 'amd64': conf.env.DEST_CPU = 'x86_64' From 2bfa4a08fac9d7ca4a7d06ad50e047634ad2f77b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 18 Jan 2025 01:51:30 +0300 Subject: [PATCH 08/11] cmake: always set empty install prefix to choose correct install path with DESTDIR --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b89c87630..4567c7a25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,8 @@ option(BUILD_SERVER "Build server dll" ON) option(LTO "Enable interprocedural optimization" OFF) option(POLLY "Enable pollyhedral optimization" OFF) +set(CMAKE_INSTALL_PREFIX "") + if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "x64" From f8819da5f33172c2a1a03eb8ed8b3fe57687b9a1 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 18 Jan 2025 01:52:18 +0300 Subject: [PATCH 09/11] cmake: set library postfix directly to the output name because CMAKE_POSTFIX doesn't seem to work with undefined build type --- cl_dll/CMakeLists.txt | 2 +- dlls/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index cbcae6ce8..a59747467 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -215,7 +215,7 @@ set_target_properties (${CLDLL_LIBRARY} PROPERTIES if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(CLDLL_NAME "client") set_target_properties(${CLDLL_LIBRARY} PROPERTIES - OUTPUT_NAME ${CLDLL_NAME} + OUTPUT_NAME "${CLDLL_NAME}${POSTFIX}" PREFIX "") endif() diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 3d15daf3b..93960e9b6 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -176,7 +176,7 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(SVDLL_NAME "${SERVER_LIBRARY_NAME}") set_target_properties(${SVDLL_LIBRARY} PROPERTIES - OUTPUT_NAME ${SVDLL_NAME} + OUTPUT_NAME "${SVDLL_NAME}${POSTFIX}" PREFIX "") endif() From 99633bd2da4b4ce8ebd119fba107bec3471de3fb Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 18 Jan 2025 01:56:21 +0300 Subject: [PATCH 10/11] cmake: LibraryNaming: remove setting up POSTFIX variables, as users are supposed to set them manually to target properties --- cmake/LibraryNaming.cmake | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 5f2634363..a20529aed 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -196,9 +196,3 @@ else() endif() message(STATUS "Library postfix: " ${POSTFIX}) - -set(CMAKE_RELEASE_POSTFIX ${POSTFIX}) -set(CMAKE_DEBUG_POSTFIX ${POSTFIX}) -set(CMAKE_RELWITHDEBINFO_POSTFIX ${POSTFIX}) -set(CMAKE_MINSIZEREL_POSTFIX ${POSTFIX}) -set(CMAKE_POSTFIX ${POSTFIX}) From 0dd8f1b148f3afc310e072aec77b28a969562125 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 18 Jan 2025 02:25:22 +0300 Subject: [PATCH 11/11] cmake: only set our install prefix if user didn't set one --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4567c7a25..ac8694329 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,9 @@ option(BUILD_SERVER "Build server dll" ON) option(LTO "Enable interprocedural optimization" OFF) option(POLLY "Enable pollyhedral optimization" OFF) -set(CMAKE_INSTALL_PREFIX "") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "") +endif() if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")