Browse Source

Add TRIPMINE_BEAM_DUPLICATION_FIX macros for fixing beam duplication on level transition (#272)

hlfixed
Roman Chistokhodov 2 years ago committed by GitHub
parent
commit
5a68ce08bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      CMakeLists.txt
  2. 5
      dlls/tripmine.cpp

6
CMakeLists.txt

@ -64,6 +64,7 @@ option(CROWBAR_IDLE_ANIM "Enable crowbar idle animation" OFF)
option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" OFF) option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" OFF)
option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF) option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF)
option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF) option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF)
option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" OFF)
option(OEM_BUILD "Enable OEM Build" OFF) option(OEM_BUILD "Enable OEM Build" OFF)
option(HLDEMO_BUILD "Enable Demo Build" OFF) option(HLDEMO_BUILD "Enable Demo Build" OFF)
@ -136,6 +137,11 @@ if(GAUSS_OVERCHARGE_FIX)
add_definitions(-DGAUSS_OVERCHARGE_FIX) add_definitions(-DGAUSS_OVERCHARGE_FIX)
endif() endif()
if(TRIPMINE_BEAM_DUPLICATION_FIX)
message(STATUS "Tripmine beam duplication fix enabled")
add_definitions(-DTRIPMINE_BEAM_DUPLICATION_FIX)
endif()
if(OEM_BUILD) if(OEM_BUILD)
message(STATUS "OEM build enabled") message(STATUS "OEM build enabled")
add_definitions(-DOEM_BUILD) add_definitions(-DOEM_BUILD)

5
dlls/tripmine.cpp

@ -82,7 +82,9 @@ TYPEDESCRIPTION CTripmineGrenade::m_SaveData[] =
DEFINE_FIELD( CTripmineGrenade, m_vecEnd, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_vecEnd, FIELD_POSITION_VECTOR ),
DEFINE_FIELD( CTripmineGrenade, m_flBeamLength, FIELD_FLOAT ), DEFINE_FIELD( CTripmineGrenade, m_flBeamLength, FIELD_FLOAT ),
DEFINE_FIELD( CTripmineGrenade, m_hOwner, FIELD_EHANDLE ), DEFINE_FIELD( CTripmineGrenade, m_hOwner, FIELD_EHANDLE ),
#if !TRIPMINE_BEAM_DUPLICATION_FIX
DEFINE_FIELD( CTripmineGrenade, m_pBeam, FIELD_CLASSPTR ), DEFINE_FIELD( CTripmineGrenade, m_pBeam, FIELD_CLASSPTR ),
#endif
DEFINE_FIELD( CTripmineGrenade, m_posOwner, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_posOwner, FIELD_POSITION_VECTOR ),
DEFINE_FIELD( CTripmineGrenade, m_angleOwner, FIELD_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_angleOwner, FIELD_VECTOR ),
DEFINE_FIELD( CTripmineGrenade, m_pRealOwner, FIELD_EDICT ), DEFINE_FIELD( CTripmineGrenade, m_pRealOwner, FIELD_EDICT ),
@ -256,6 +258,9 @@ void CTripmineGrenade::MakeBeam( void )
Vector vecTmpEnd = pev->origin + m_vecDir * 2048.0f * m_flBeamLength; Vector vecTmpEnd = pev->origin + m_vecDir * 2048.0f * m_flBeamLength;
m_pBeam = CBeam::BeamCreate( g_pModelNameLaser, 10 ); m_pBeam = CBeam::BeamCreate( g_pModelNameLaser, 10 );
#if TRIPMINE_BEAM_DUPLICATION_FIX
m_pBeam->pev->spawnflags |= SF_BEAM_TEMPORARY;
#endif
m_pBeam->PointEntInit( vecTmpEnd, entindex() ); m_pBeam->PointEntInit( vecTmpEnd, entindex() );
m_pBeam->SetColor( 0, 214, 198 ); m_pBeam->SetColor( 0, 214, 198 );
m_pBeam->SetScrollRate( 255 ); m_pBeam->SetScrollRate( 255 );

Loading…
Cancel
Save