Skip to content

Commit

Permalink
Merge branch 'master' into gravgun
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Jan 18, 2025
2 parents 913b607 + 0dd8f1b commit c0f1632
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ option(BUILD_SERVER "Build server dll" ON)
option(LTO "Enable interprocedural optimization" OFF)
option(POLLY "Enable pollyhedral optimization" OFF)

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")
AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "x64"
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions cl_dll/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
6 changes: 0 additions & 6 deletions cmake/LibraryNaming.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion dlls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,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()

Expand Down
10 changes: 10 additions & 0 deletions dlls/func_break.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}
5 changes: 3 additions & 2 deletions dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -3161,7 +3161,6 @@ void CBasePlayer::Precache( void )
m_flgeigerRange = 1000;
m_igeigerRangePrev = 1000;

m_bitsDamageType = 0;
m_bitsHUDDamage = -1;

m_iClientBattery = -1;
Expand All @@ -3175,6 +3174,8 @@ void CBasePlayer::Precache( void )

m_iUpdateTime = 5; // won't update for 1/2 a second

m_nCustomSprayFrames = -1;

if( gInitHUD )
m_fInitHUD = TRUE;

Expand Down
16 changes: 13 additions & 3 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,26 @@ 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')
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')

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'
Expand Down

0 comments on commit c0f1632

Please sign in to comment.