diff --git a/CMakeLists.txt b/CMakeLists.txt index 75372379..ab6a1872 100644 --- a/CMakeLists.txt +++ b/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_FIX_RAPID_CROWBAR "Enable rapid crowbar 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(HLDEMO_BUILD "Enable Demo Build" OFF) @@ -136,6 +137,11 @@ if(GAUSS_OVERCHARGE_FIX) add_definitions(-DGAUSS_OVERCHARGE_FIX) endif() +if(TRIPMINE_BEAM_DUPLICATION_FIX) + message(STATUS "Tripmine beam duplication fix enabled") + add_definitions(-DTRIPMINE_BEAM_DUPLICATION_FIX) +endif() + if(OEM_BUILD) message(STATUS "OEM build enabled") add_definitions(-DOEM_BUILD) diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 7c41b3a6..e9e55b67 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -82,7 +82,9 @@ TYPEDESCRIPTION CTripmineGrenade::m_SaveData[] = DEFINE_FIELD( CTripmineGrenade, m_vecEnd, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_flBeamLength, FIELD_FLOAT ), DEFINE_FIELD( CTripmineGrenade, m_hOwner, FIELD_EHANDLE ), +#if !TRIPMINE_BEAM_DUPLICATION_FIX DEFINE_FIELD( CTripmineGrenade, m_pBeam, FIELD_CLASSPTR ), +#endif DEFINE_FIELD( CTripmineGrenade, m_posOwner, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_angleOwner, FIELD_VECTOR ), 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; 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->SetColor( 0, 214, 198 ); m_pBeam->SetScrollRate( 255 );