diff --git a/CMakeLists.txt b/CMakeLists.txt index 110bc3db9..d22391809 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,8 @@ set(XASH_LIBDL true) set(CMAKE_CXX_STANDARD 17) if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") - option(XASH_PCH "Enable PCH support." OFF) + option(XASH_PCH "Enable PCH support." ON) + option(XASH_UNITY_BUILD "Enable Unity Build support." ON) endif() option(XASH_VCPKG "Enable VCPKG support." OFF) @@ -38,6 +39,14 @@ if(XASH_PCH) if(${CMAKE_VERSION} VERSION_LESS "3.16.0") message(FATAL_ERROR "PCH is not supported. Please update to CMake 3.16 or higher.") endif() + add_definitions(-DXASH_PCH=1) +endif() + +if(XASH_UNITY_BUILD) + if(${CMAKE_VERSION} VERSION_LESS "3.16.0") + message(FATAL_ERROR "Unity build is not supported. Please update to CMake 3.16 or higher.") + endif() + add_definitions(-DXASH_UNITY_BUILD=1) endif() if(XASH_STATIC_GAMELIB) @@ -60,6 +69,11 @@ else() add_compile_options( -Wall -Wextra -Wno-unused-parameter -Wl,--no-undefined ) endif() +# Important, as HLSDK and engine shares some symbol names! +if(NOT WIN32) # Windows by default have hidden visibility and better linker + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") +endif() + if(CMAKE_COMPILER_IS_GNUCXX) add_compile_options(-Wpedantic) add_compile_options(-fPIC) @@ -157,6 +171,10 @@ if(XASH_IMGUI) target_include_directories(imgui_ext PRIVATE ${CMAKE_SOURCE_DIR}/imgui_ext/dirent) endif() target_link_libraries(imgui_ext PUBLIC imgui) + if(XASH_UNITY_BUILD) + set_target_properties(imgui PROPERTIES UNITY_BUILD ON) + set_target_properties(imgui_ext PROPERTIES UNITY_BUILD ON) + endif() endif() if(XASH_LUASH) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 43656d7ac..be69d9831 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -314,7 +314,7 @@ include_directories ( ) if(XASH_STATIC_GAMELIB) - add_library (${CLIENT_LIBRARY} STATIC ${CLDLL_SOURCES}) + add_library (${CLIENT_LIBRARY} STATIC ${CLDLL_SOURCES} "events/eventdef.h") else() add_library (${CLIENT_LIBRARY} SHARED ${CLDLL_SOURCES}) endif() @@ -385,3 +385,7 @@ endif() if(XASH_PCH) target_precompile_headers(${CLIENT_LIBRARY} PRIVATE stdafx.h) endif() + +if(XASH_UNITY_BUILD) + set_target_properties(${CLIENT_LIBRARY} PROPERTIES UNITY_BUILD ON) +endif() diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index 36377a608..e48b21eae 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -111,10 +111,6 @@ inline void PlaySound( const char *szSound, float vol ) { gEngfuncs.pfnPlaySound inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); } #include "minmax.h" -#ifndef __APPLE__ -// template functions are considered after non-template functions, so it will not conflict with math.h -template constexpr T fabs(T x) { return ((x) > 0 ? (x) : 0 - (x)); } -#endif #ifdef VectorSubtract #undef VectorSubtract diff --git a/cl_dll/com_weapons.cpp b/cl_dll/com_weapons.cpp index 60ffa87a3..4bbf28154 100644 --- a/cl_dll/com_weapons.cpp +++ b/cl_dll/com_weapons.cpp @@ -161,22 +161,6 @@ void HUD_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short event bparam1, bparam2 ); } - - -/* -===================== -UTIL_WeaponTimeBase - -Always 0.0 on client, even if not predicting weapons ( won't get called - in that case ) -===================== -*/ -inline std::chrono::duration UTIL_WeaponTimeBase( void ) -{ - return {}; -} - - static unsigned int glSeed = 0; unsigned int seed_table[ 256 ] = diff --git a/cl_dll/events.h b/cl_dll/events.h index c9e2893c6..ee9f2cbf3 100644 --- a/cl_dll/events.h +++ b/cl_dll/events.h @@ -45,9 +45,6 @@ #include "angledef.h" -#define DECLARE_EVENT( x ) void EV_##x( struct event_args_s *args ) -#define HOOK_EVENT( x, y ) gEngfuncs.pfnHookEvent( "events/" #x ".sc", EV_##y ) - #define PLAY_EVENT_SOUND( x ) gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, (x), VOL_NORM, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 15 ) ) diff --git a/cl_dll/events/event_ak47.cpp b/cl_dll/events/event_ak47.cpp index cef464797..1088d8202 100644 --- a/cl_dll/events/event_ak47.cpp +++ b/cl_dll/events/event_ak47.cpp @@ -27,8 +27,8 @@ */ #include "events.h" -namespace cl { - +namespace cl::event::ak47 { + enum ak47_e { AK47_IDLE1 = 0, diff --git a/cl_dll/events/event_ak47dragon.cpp b/cl_dll/events/event_ak47dragon.cpp index 3aeec723d..a993dfa71 100644 --- a/cl_dll/events/event_ak47dragon.cpp +++ b/cl_dll/events/event_ak47dragon.cpp @@ -27,8 +27,8 @@ */ #include "events.h" -namespace cl { - +namespace cl::event::ak47dragon { + enum ak47_e { AK47_IDLE1 = 0, diff --git a/cl_dll/events/event_ak47l.cpp b/cl_dll/events/event_ak47l.cpp index 86916779a..6a9dee9f3 100644 --- a/cl_dll/events/event_ak47l.cpp +++ b/cl_dll/events/event_ak47l.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::ak47l { enum ak47_e { diff --git a/cl_dll/events/event_ak47x.cpp b/cl_dll/events/event_ak47x.cpp index fa8f0edec..f5ddff24e 100644 --- a/cl_dll/events/event_ak47x.cpp +++ b/cl_dll/events/event_ak47x.cpp @@ -14,17 +14,17 @@ GNU General Public License for more details. */ #include "events.h" -namespace cl { - - enum - { - ANIM_IDLE1 = 0, - ANIM_RELOAD, - ANIM_DRAW, - ANIM_SHOOT1, - ANIM_SHOOT2, - ANIM_SHOOT3 - }; +namespace cl::event::ak47x { + +enum +{ + ANIM_IDLE1 = 0, + ANIM_RELOAD, + ANIM_DRAW, + ANIM_SHOOT1, + ANIM_SHOOT2, + ANIM_SHOOT3 +}; static const char *SOUNDS_NAME[] = { diff --git a/cl_dll/events/event_anaconda.cpp b/cl_dll/events/event_anaconda.cpp index b1e51de4b..922d4ab73 100644 --- a/cl_dll/events/event_anaconda.cpp +++ b/cl_dll/events/event_anaconda.cpp @@ -27,8 +27,8 @@ */ #include "events.h" -namespace cl { - +namespace cl::event::anaconda { + enum deagle_e { DEAGLE_IDLE1 = 0, diff --git a/cl_dll/events/event_as50.cpp b/cl_dll/events/event_as50.cpp index a9073fc79..c1d33d1e0 100644 --- a/cl_dll/events/event_as50.cpp +++ b/cl_dll/events/event_as50.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::as50 { enum as50_e { diff --git a/cl_dll/events/event_aug.cpp b/cl_dll/events/event_aug.cpp index 3db51a9d0..079764372 100644 --- a/cl_dll/events/event_aug.cpp +++ b/cl_dll/events/event_aug.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::aug { enum aug_e { diff --git a/cl_dll/events/event_awp.cpp b/cl_dll/events/event_awp.cpp index 8a6a678b5..add1c2b1f 100644 --- a/cl_dll/events/event_awp.cpp +++ b/cl_dll/events/event_awp.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::awp { enum awp_e { diff --git a/cl_dll/events/event_balrog7.cpp b/cl_dll/events/event_balrog7.cpp index 3da509381..e70a17097 100644 --- a/cl_dll/events/event_balrog7.cpp +++ b/cl_dll/events/event_balrog7.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::balrog7 { enum balrog7_e { diff --git a/cl_dll/events/event_bizon.cpp b/cl_dll/events/event_bizon.cpp index 3118d5f55..9e714ad5b 100644 --- a/cl_dll/events/event_bizon.cpp +++ b/cl_dll/events/event_bizon.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::bizon { enum bizon_e { diff --git a/cl_dll/events/event_bow.cpp b/cl_dll/events/event_bow.cpp index 808bdc4de..0e59304da 100644 --- a/cl_dll/events/event_bow.cpp +++ b/cl_dll/events/event_bow.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::bow { enum bow_e { diff --git a/cl_dll/events/event_cannon.cpp b/cl_dll/events/event_cannon.cpp index b6be550e5..4fe1875c9 100644 --- a/cl_dll/events/event_cannon.cpp +++ b/cl_dll/events/event_cannon.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::cannon { enum cannon_e { diff --git a/cl_dll/events/event_cannonplasma.cpp b/cl_dll/events/event_cannonplasma.cpp index 1da041c5f..794a4c017 100644 --- a/cl_dll/events/event_cannonplasma.cpp +++ b/cl_dll/events/event_cannonplasma.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::cannonplasma { enum cannonplasma_e { diff --git a/cl_dll/events/event_cannontiger.cpp b/cl_dll/events/event_cannontiger.cpp index 5e884deeb..76d53d1fc 100644 --- a/cl_dll/events/event_cannontiger.cpp +++ b/cl_dll/events/event_cannontiger.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::cannontiger { enum cannontiger_e { diff --git a/cl_dll/events/event_chainsaw.cpp b/cl_dll/events/event_chainsaw.cpp index b2681a2af..feda13a36 100644 --- a/cl_dll/events/event_chainsaw.cpp +++ b/cl_dll/events/event_chainsaw.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::chainsaw { enum chainsaw_e { diff --git a/cl_dll/events/event_createexplo.cpp b/cl_dll/events/event_createexplo.cpp index 6c4556939..b8a272d34 100644 --- a/cl_dll/events/event_createexplo.cpp +++ b/cl_dll/events/event_createexplo.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::createexplo { void EV_CreateExplo(event_args_s *args) { diff --git a/cl_dll/events/event_createsmoke.cpp b/cl_dll/events/event_createsmoke.cpp index e7c421668..531d0b386 100644 --- a/cl_dll/events/event_createsmoke.cpp +++ b/cl_dll/events/event_createsmoke.cpp @@ -29,7 +29,7 @@ #include "com_model.h" -namespace cl { +namespace cl::event::createsmoke { #define SMOKE_CLOUDS 20 diff --git a/cl_dll/events/event_cz75.cpp b/cl_dll/events/event_cz75.cpp index 3a3c98b4a..23c2a0014 100644 --- a/cl_dll/events/event_cz75.cpp +++ b/cl_dll/events/event_cz75.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::cz75 { enum cz75_e { diff --git a/cl_dll/events/event_deagle.cpp b/cl_dll/events/event_deagle.cpp index a9581bddd..2cb99d14c 100644 --- a/cl_dll/events/event_deagle.cpp +++ b/cl_dll/events/event_deagle.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::deagle { enum deagle_e { diff --git a/cl_dll/events/event_deagleb.cpp b/cl_dll/events/event_deagleb.cpp index 3b772cf78..5a5121c41 100644 --- a/cl_dll/events/event_deagleb.cpp +++ b/cl_dll/events/event_deagleb.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::deagleb { enum { diff --git a/cl_dll/events/event_deagled.cpp b/cl_dll/events/event_deagled.cpp index 17c883c95..bba7234cb 100644 --- a/cl_dll/events/event_deagled.cpp +++ b/cl_dll/events/event_deagled.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::deagled { enum elite_e { @@ -89,7 +89,7 @@ void EV_FireDeagleD( event_args_s *args, int sequence ) EV_GetGunPosition( args, vecSrc, origin ); VectorCopy( forward, vecAiming ); Vector vSpread; - + vSpread.x = args->fparam1; vSpread.y = args->fparam2; EV_HLDM_FireBullets( idx, @@ -99,13 +99,21 @@ void EV_FireDeagleD( event_args_s *args, int sequence ) 2 ); } +} + +namespace cl::event::deagled_left { void EV_FireDeagleD_Left(event_args_s *args) { + using namespace cl::event::deagled; EV_FireDeagleD( args, Com_RandomLong( ELITE_SHOOTLEFT1, ELITE_SHOOTLEFT4 )); } +} + +namespace cl::event::deagled_right { void EV_FireDeagleD_Right( event_args_s *args ) { + using namespace cl::event::deagled; EV_FireDeagleD( args, Com_RandomLong( ELITE_SHOOTRIGHT1, ELITE_SHOOTRIGHT4 )); } diff --git a/cl_dll/events/event_decal_reset.cpp b/cl_dll/events/event_decal_reset.cpp index 0ae59415b..794d6c569 100644 --- a/cl_dll/events/event_decal_reset.cpp +++ b/cl_dll/events/event_decal_reset.cpp @@ -31,7 +31,7 @@ float g_flRoundTime = 0.0f; -namespace cl { +namespace cl::event::decal_reset { void EV_DecalReset(event_args_s *args) { diff --git a/cl_dll/events/event_desperado.cpp b/cl_dll/events/event_desperado.cpp index 14fd3082e..4ede6e977 100644 --- a/cl_dll/events/event_desperado.cpp +++ b/cl_dll/events/event_desperado.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::desperado { enum desperado_e { diff --git a/cl_dll/events/event_effects.cpp b/cl_dll/events/event_effects.cpp index 69b0e2497..9d2677994 100644 --- a/cl_dll/events/event_effects.cpp +++ b/cl_dll/events/event_effects.cpp @@ -30,16 +30,19 @@ #include "r_studioint.h" #include -enum event_effect -{ - EVENT_GATLINGRX, - EVENT_DUALSWORD, - EVENT_VOIDPISTOL -}; namespace cl { + extern engine_studio_api_t IEngineStudio; +} -extern engine_studio_api_t IEngineStudio; +namespace cl::event::wpneffects { + +enum event_effect +{ + EVENT_GATLINGRX, + EVENT_DUALSWORD, + EVENT_VOIDPISTOL +}; static const char* SOUNDS_NAME[] = { diff --git a/cl_dll/events/event_elite_left.cpp b/cl_dll/events/event_elite_left.cpp index 2f937b4e2..3d56870ca 100644 --- a/cl_dll/events/event_elite_left.cpp +++ b/cl_dll/events/event_elite_left.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::elite { enum elite_e { @@ -89,7 +89,7 @@ void EV_FireElite( event_args_s *args, int sequence ) EV_GetGunPosition( args, vecSrc, origin ); VectorCopy( forward, vecAiming ); Vector vSpread; - + vSpread.x = args->fparam1; vSpread.y = args->fparam2; EV_HLDM_FireBullets( idx, @@ -99,11 +99,21 @@ void EV_FireElite( event_args_s *args, int sequence ) 2 ); } +} + +namespace cl::event::elite_left { + +using namespace cl::event::elite; void EV_FireEliteLeft(event_args_s *args) { EV_FireElite( args, Com_RandomLong( ELITE_SHOOTLEFT1, ELITE_SHOOTLEFT4 )); } +} + +namespace cl::event::elite_right { + +using namespace cl::event::elite; void EV_FireEliteRight( event_args_s *args ) { EV_FireElite( args, Com_RandomLong( ELITE_SHOOTRIGHT1, ELITE_SHOOTRIGHT4 )); diff --git a/cl_dll/events/event_famas.cpp b/cl_dll/events/event_famas.cpp index 519ac0291..45097414c 100644 --- a/cl_dll/events/event_famas.cpp +++ b/cl_dll/events/event_famas.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::famas { enum famas_e { diff --git a/cl_dll/events/event_fiveseven.cpp b/cl_dll/events/event_fiveseven.cpp index b9d0a849e..2934cb176 100644 --- a/cl_dll/events/event_fiveseven.cpp +++ b/cl_dll/events/event_fiveseven.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::fiveseven { enum fiveseven_e { diff --git a/cl_dll/events/event_g3sg1.cpp b/cl_dll/events/event_g3sg1.cpp index fed7cf1e0..1999c3d82 100644 --- a/cl_dll/events/event_g3sg1.cpp +++ b/cl_dll/events/event_g3sg1.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::g3sg1 { enum g3sg1_e { diff --git a/cl_dll/events/event_galil.cpp b/cl_dll/events/event_galil.cpp index f9fc24f49..35177cc98 100644 --- a/cl_dll/events/event_galil.cpp +++ b/cl_dll/events/event_galil.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::galil { enum galil_e { diff --git a/cl_dll/events/event_gatling.cpp b/cl_dll/events/event_gatling.cpp index 02a2f0287..18e7eb84f 100644 --- a/cl_dll/events/event_gatling.cpp +++ b/cl_dll/events/event_gatling.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::gatling { enum gatling_e { diff --git a/cl_dll/events/event_gatlingex.cpp b/cl_dll/events/event_gatlingex.cpp index 7041cb4ab..524242356 100644 --- a/cl_dll/events/event_gatlingex.cpp +++ b/cl_dll/events/event_gatlingex.cpp @@ -31,8 +31,10 @@ #include namespace cl { + extern engine_studio_api_t IEngineStudio; +} -extern engine_studio_api_t IEngineStudio; +namespace cl::event::gatlingex { enum gatling_e { diff --git a/cl_dll/events/event_glock18.cpp b/cl_dll/events/event_glock18.cpp index a9910ce74..f52fb7e14 100644 --- a/cl_dll/events/event_glock18.cpp +++ b/cl_dll/events/event_glock18.cpp @@ -28,7 +28,10 @@ #include "events.h" namespace cl { -bool g_bGlockBurstMode = false; + bool g_bGlockBurstMode = false; +} + +namespace cl::event::glock18 { enum glock18_e { diff --git a/cl_dll/events/event_gungnir.cpp b/cl_dll/events/event_gungnir.cpp index fc357d031..4d58b49ef 100644 --- a/cl_dll/events/event_gungnir.cpp +++ b/cl_dll/events/event_gungnir.cpp @@ -15,7 +15,7 @@ GNU General Public License for more details. #include "events.h" -namespace cl { +namespace cl::event::gungnir { enum { diff --git a/cl_dll/events/event_gunkata.cpp b/cl_dll/events/event_gunkata.cpp index eb2a6111a..e4078143b 100644 --- a/cl_dll/events/event_gunkata.cpp +++ b/cl_dll/events/event_gunkata.cpp @@ -20,9 +20,10 @@ GNU General Public License for more details. #include namespace cl { + extern engine_studio_api_t IEngineStudio; +} -extern engine_studio_api_t IEngineStudio; - +namespace cl::event::gunkata { enum { ANIM_IDLE = 0, //6.0 diff --git a/cl_dll/events/event_infinity.cpp b/cl_dll/events/event_infinity.cpp index 960302768..763ec4f1d 100644 --- a/cl_dll/events/event_infinity.cpp +++ b/cl_dll/events/event_infinity.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::infinity { enum infinity_e { @@ -87,7 +87,7 @@ void EV_FireInfinity( event_args_s *args, int sequence, int direction ) EV_GetGunPosition( args, vecSrc, origin ); VectorCopy( forward, vecAiming ); Vector vSpread; - + vSpread.x = args->fparam1; vSpread.y = args->fparam2; EV_HLDM_FireBullets( idx, @@ -97,6 +97,10 @@ void EV_FireInfinity( event_args_s *args, int sequence, int direction ) 2 ); } +} + +namespace cl::event::infinity_left { +using namespace cl::event::infinity; void EV_FireInfinity_Left(event_args_s *args) { if(!args->bparam1) @@ -107,6 +111,10 @@ void EV_FireInfinity_Left(event_args_s *args) EV_FireInfinity(args, ANIM_SP_SHOOT_LEFT2, 0); } +} + +namespace cl::event::infinity_right { +using namespace cl::event::infinity; void EV_FireInfinity_Right( event_args_s *args ) { if (!args->bparam1) diff --git a/cl_dll/events/event_infinitys.cpp b/cl_dll/events/event_infinitys.cpp index 024a6dac7..2a32667e5 100644 --- a/cl_dll/events/event_infinitys.cpp +++ b/cl_dll/events/event_infinitys.cpp @@ -15,7 +15,7 @@ GNU General Public License for more details. #include "events.h" -namespace cl { +namespace cl::event::infinitys { enum { @@ -92,3 +92,24 @@ void EV_FireInfinityS(event_args_t *args) } } + +namespace cl::event::infinityss { + void EV_FireInfinitySS(event_args_t *args) + { + return cl::event::infinitys::EV_FireInfinityS(args); + } +} + +namespace cl::event::infinitysr { + void EV_FireInfinitySR(event_args_t *args) + { + return cl::event::infinitys::EV_FireInfinityS(args); + } +} + +namespace cl::event::infinitysb { + void EV_FireInfinitySB(event_args_t *args) + { + return cl::event::infinitys::EV_FireInfinityS(args); + } +} diff --git a/cl_dll/events/event_infinityx.cpp b/cl_dll/events/event_infinityx.cpp index c93f1843d..95d20531c 100644 --- a/cl_dll/events/event_infinityx.cpp +++ b/cl_dll/events/event_infinityx.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::infinityx { enum infinityx_e { @@ -87,7 +87,7 @@ void EV_FireInfinityX( event_args_s *args, int sequence, int direction ) EV_GetGunPosition( args, vecSrc, origin ); VectorCopy( forward, vecAiming ); Vector vSpread; - + vSpread.x = args->fparam1; vSpread.y = args->fparam2; EV_HLDM_FireBullets( idx, @@ -97,6 +97,10 @@ void EV_FireInfinityX( event_args_s *args, int sequence, int direction ) 2 ); } +} + +namespace cl::event::infinityx_left { +using namespace cl::event::infinityx; void EV_FireInfinityX_Left(event_args_s *args) { if(!args->bparam1) @@ -107,6 +111,10 @@ void EV_FireInfinityX_Left(event_args_s *args) EV_FireInfinityX(args, ANIM_SP_SHOOT_LEFT2, 0); } +} + +namespace cl::event::infinityx_right { +using namespace cl::event::infinityx; void EV_FireInfinityX_Right( event_args_s *args ) { if (!args->bparam1) diff --git a/cl_dll/events/event_janus7xmas.cpp b/cl_dll/events/event_janus7xmas.cpp index e9608ccad..75eb33b9b 100644 --- a/cl_dll/events/event_janus7xmas.cpp +++ b/cl_dll/events/event_janus7xmas.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::janus7xmas { static const char *SOUND_NAME = "weapons/janus7-1.wav"; diff --git a/cl_dll/events/event_k1a.cpp b/cl_dll/events/event_k1a.cpp index 162396e94..92527c49a 100644 --- a/cl_dll/events/event_k1a.cpp +++ b/cl_dll/events/event_k1a.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::k1a { enum k1a_e { diff --git a/cl_dll/events/event_knife.cpp b/cl_dll/events/event_knife.cpp index bdcc5767f..82cc90201 100644 --- a/cl_dll/events/event_knife.cpp +++ b/cl_dll/events/event_knife.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::knife { enum knife_e { diff --git a/cl_dll/events/event_knifedragon.cpp b/cl_dll/events/event_knifedragon.cpp index f14edbaed..12a544098 100644 --- a/cl_dll/events/event_knifedragon.cpp +++ b/cl_dll/events/event_knifedragon.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::knifedragon { enum knife_e { diff --git a/cl_dll/events/event_kriss.cpp b/cl_dll/events/event_kriss.cpp index 43d645940..2818f8352 100644 --- a/cl_dll/events/event_kriss.cpp +++ b/cl_dll/events/event_kriss.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::kriss { enum kriss_e { diff --git a/cl_dll/events/event_m134.cpp b/cl_dll/events/event_m134.cpp index 48a3a005a..c5605b97b 100644 --- a/cl_dll/events/event_m134.cpp +++ b/cl_dll/events/event_m134.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m134 { enum m134_e { diff --git a/cl_dll/events/event_m134ex.cpp b/cl_dll/events/event_m134ex.cpp index 42376cc9d..bc8c73db6 100644 --- a/cl_dll/events/event_m134ex.cpp +++ b/cl_dll/events/event_m134ex.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m134ex { enum m134ex_e { diff --git a/cl_dll/events/event_m134heroi.cpp b/cl_dll/events/event_m134heroi.cpp index 35718a2cd..50945efa7 100644 --- a/cl_dll/events/event_m134heroi.cpp +++ b/cl_dll/events/event_m134heroi.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m134heroi { static const char *SOUND_NAME = "weapons/m134-1.wav"; @@ -93,7 +93,7 @@ void EV_FireM134HeroI(event_args_s *args) EV_GetGunPosition( args, vecSrc, origin ); VectorCopy( forward, vecAiming ); Vector vSpread; - + vSpread.x = args->fparam1; vSpread.y = args->fparam2; EV_HLDM_FireBullets( idx, @@ -103,7 +103,6 @@ void EV_FireM134HeroI(event_args_s *args) 2 ); } - //====================== // EGON END //====================== @@ -120,6 +119,11 @@ enum EGON_FIREMODE { FIRE_NARROW, FIRE_WIDE}; BEAM *pBeam; BEAM *pBeam2; +} + +namespace cl::event::m134heroi_fire { + +using namespace cl::event::m134heroi; void EV_FireM134HeroI_EgonFire( event_args_t *args ) { @@ -211,6 +215,12 @@ void EV_FireM134HeroI_EgonFire( event_args_t *args ) } } +} + +namespace cl::event::m134heroi_stop { + +using namespace cl::event::m134heroi; + void EV_FireM134HeroI_EgonStop( event_args_t *args ) { int idx; diff --git a/cl_dll/events/event_m134xmas.cpp b/cl_dll/events/event_m134xmas.cpp index c3916368e..d588adb06 100644 --- a/cl_dll/events/event_m134xmas.cpp +++ b/cl_dll/events/event_m134xmas.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m134xmas { enum m134xmas_e { diff --git a/cl_dll/events/event_m14ebr.cpp b/cl_dll/events/event_m14ebr.cpp index 0eccc2da8..c495fa4c7 100644 --- a/cl_dll/events/event_m14ebr.cpp +++ b/cl_dll/events/event_m14ebr.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m14ebr { enum m14ebr_e { diff --git a/cl_dll/events/event_m1887.cpp b/cl_dll/events/event_m1887.cpp index 17743ed37..48cd9bd50 100644 --- a/cl_dll/events/event_m1887.cpp +++ b/cl_dll/events/event_m1887.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m1887 { enum m1887_e { diff --git a/cl_dll/events/event_m2.cpp b/cl_dll/events/event_m2.cpp index fb28a256e..922589e68 100644 --- a/cl_dll/events/event_m2.cpp +++ b/cl_dll/events/event_m2.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m2 { enum M2_e { diff --git a/cl_dll/events/event_m249.cpp b/cl_dll/events/event_m249.cpp index 240670c77..5bd6dd4aa 100644 --- a/cl_dll/events/event_m249.cpp +++ b/cl_dll/events/event_m249.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m249 { enum m249_e { diff --git a/cl_dll/events/event_m3.cpp b/cl_dll/events/event_m3.cpp index aade684f5..65873864b 100644 --- a/cl_dll/events/event_m3.cpp +++ b/cl_dll/events/event_m3.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m3 { enum m3_e { diff --git a/cl_dll/events/event_m4a1.cpp b/cl_dll/events/event_m4a1.cpp index e2eb34ffd..aa7915d00 100644 --- a/cl_dll/events/event_m4a1.cpp +++ b/cl_dll/events/event_m4a1.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m4a1 { enum m4a1_e { diff --git a/cl_dll/events/event_m4a1dragon.cpp b/cl_dll/events/event_m4a1dragon.cpp index ad7e65810..9a0fcad83 100644 --- a/cl_dll/events/event_m4a1dragon.cpp +++ b/cl_dll/events/event_m4a1dragon.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m4a1dragon { enum m4a1_e { diff --git a/cl_dll/events/event_m4a1mw.cpp b/cl_dll/events/event_m4a1mw.cpp index 353eb4a30..69bad3705 100644 --- a/cl_dll/events/event_m4a1mw.cpp +++ b/cl_dll/events/event_m4a1mw.cpp @@ -14,7 +14,7 @@ GNU General Public License for more details. */ #include "events.h" -namespace cl { +namespace cl::event::m4a1mw { enum { diff --git a/cl_dll/events/event_m4a1razer.cpp b/cl_dll/events/event_m4a1razer.cpp index 80716c61b..63368f45e 100644 --- a/cl_dll/events/event_m4a1razer.cpp +++ b/cl_dll/events/event_m4a1razer.cpp @@ -14,7 +14,7 @@ GNU General Public License for more details. */ #include "events.h" -namespace cl { +namespace cl::event::m4a1razer { enum { diff --git a/cl_dll/events/event_m4a1x.cpp b/cl_dll/events/event_m4a1x.cpp index 6768c4f9f..ac599ac32 100644 --- a/cl_dll/events/event_m4a1x.cpp +++ b/cl_dll/events/event_m4a1x.cpp @@ -14,7 +14,7 @@ GNU General Public License for more details. */ #include "events.h" -namespace cl { +namespace cl::event::m4a1x { enum { diff --git a/cl_dll/events/event_m95.cpp b/cl_dll/events/event_m95.cpp index 638d80836..8ad5c841b 100644 --- a/cl_dll/events/event_m95.cpp +++ b/cl_dll/events/event_m95.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m95 { enum m95_e { diff --git a/cl_dll/events/event_m95xmas.cpp b/cl_dll/events/event_m95xmas.cpp index 4260335d1..dc22050de 100644 --- a/cl_dll/events/event_m95xmas.cpp +++ b/cl_dll/events/event_m95xmas.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::m95xmas { enum m95xmas_e { diff --git a/cl_dll/events/event_mac10.cpp b/cl_dll/events/event_mac10.cpp index a6b3f3f5b..9319bd7c1 100644 --- a/cl_dll/events/event_mac10.cpp +++ b/cl_dll/events/event_mac10.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::mac10 { enum mac10_e { diff --git a/cl_dll/events/event_mag7.cpp b/cl_dll/events/event_mag7.cpp index 7648053a0..d3a555717 100644 --- a/cl_dll/events/event_mag7.cpp +++ b/cl_dll/events/event_mag7.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::mag7 { enum mag7_e { diff --git a/cl_dll/events/event_mg3.cpp b/cl_dll/events/event_mg3.cpp index b8a1488c5..aa8585cf2 100644 --- a/cl_dll/events/event_mg3.cpp +++ b/cl_dll/events/event_mg3.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::mg3 { static const char *SOUND_NAME = "weapons/mg3-1"; diff --git a/cl_dll/events/event_mg36.cpp b/cl_dll/events/event_mg36.cpp index 991d43d32..bfac26b8b 100644 --- a/cl_dll/events/event_mg36.cpp +++ b/cl_dll/events/event_mg36.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::mg36 { enum m249_e { diff --git a/cl_dll/events/event_mg3xmas.cpp b/cl_dll/events/event_mg3xmas.cpp index b8886bbd5..3458c14d7 100644 --- a/cl_dll/events/event_mg3xmas.cpp +++ b/cl_dll/events/event_mg3xmas.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::mg3xmas { static const char *SOUND_NAME = "weapons/mg3-1.wav"; diff --git a/cl_dll/events/event_mp5n.cpp b/cl_dll/events/event_mp5n.cpp index 40c29912e..b21dc6dc5 100644 --- a/cl_dll/events/event_mp5n.cpp +++ b/cl_dll/events/event_mp5n.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::mp5n { enum mp5n_e { diff --git a/cl_dll/events/event_mp7a1c.cpp b/cl_dll/events/event_mp7a1c.cpp index af1e2d2b0..81c2cb3c3 100644 --- a/cl_dll/events/event_mp7a1c.cpp +++ b/cl_dll/events/event_mp7a1c.cpp @@ -15,7 +15,7 @@ GNU General Public License for more details. #include "events.h" -namespace cl { +namespace cl::event::mp7a1c { enum mp7a1_e { diff --git a/cl_dll/events/event_mp7a1d.cpp b/cl_dll/events/event_mp7a1d.cpp index 1b3780d5d..4fcd37296 100644 --- a/cl_dll/events/event_mp7a1d.cpp +++ b/cl_dll/events/event_mp7a1d.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::mp7a1d { enum elite_e { @@ -89,7 +89,7 @@ void EV_FireMP7A1D( event_args_s *args, int sequence ) EV_GetGunPosition( args, vecSrc, origin ); VectorCopy( forward, vecAiming ); Vector vSpread; - + vSpread.x = args->fparam1; vSpread.y = args->fparam2; EV_HLDM_FireBullets( idx, @@ -98,14 +98,20 @@ void EV_FireMP7A1D( event_args_s *args, int sequence ) vSpread, 8192.0, BULLET_PLAYER_9MM, 2 ); } +} +namespace cl::event::mp7a1d_left { void EV_FireMP7A1D_Left(event_args_s *args) { + using namespace cl::event::mp7a1d; EV_FireMP7A1D( args, Com_RandomLong( ELITE_SHOOTLEFT1, ELITE_SHOOTLEFT4 )); } +} +namespace cl::event::mp7a1d_right { void EV_FireMP7A1D_Right( event_args_s *args ) { + using namespace cl::event::mp7a1d; EV_FireMP7A1D( args, Com_RandomLong( ELITE_SHOOTRIGHT1, ELITE_SHOOTRIGHT4 )); } diff --git a/cl_dll/events/event_mp7a1p.cpp b/cl_dll/events/event_mp7a1p.cpp index 470a03095..2e50fcd6b 100644 --- a/cl_dll/events/event_mp7a1p.cpp +++ b/cl_dll/events/event_mp7a1p.cpp @@ -15,7 +15,7 @@ GNU General Public License for more details. #include "events.h" -namespace cl { +namespace cl::event::mp7a1p { enum mp7a1_e { diff --git a/cl_dll/events/event_negev.cpp b/cl_dll/events/event_negev.cpp index c547128ed..6fcad5b71 100644 --- a/cl_dll/events/event_negev.cpp +++ b/cl_dll/events/event_negev.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::negev { static const char *SOUND_NAME = "weapons/csgo_ports/negev/negev-1.wav"; diff --git a/cl_dll/events/event_p228.cpp b/cl_dll/events/event_p228.cpp index 9c726f924..0fb361f58 100644 --- a/cl_dll/events/event_p228.cpp +++ b/cl_dll/events/event_p228.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::p228 { enum p228_e { diff --git a/cl_dll/events/event_p90.cpp b/cl_dll/events/event_p90.cpp index 7cbe959fa..b6bc8634b 100644 --- a/cl_dll/events/event_p90.cpp +++ b/cl_dll/events/event_p90.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::p90 { enum p90_e { diff --git a/cl_dll/events/event_r8.cpp b/cl_dll/events/event_r8.cpp index 3c0cb3d1e..407d0d877 100644 --- a/cl_dll/events/event_r8.cpp +++ b/cl_dll/events/event_r8.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::r8 { enum r8_e { diff --git a/cl_dll/events/event_sawedoff.cpp b/cl_dll/events/event_sawedoff.cpp index e027cf112..5a99f0962 100644 --- a/cl_dll/events/event_sawedoff.cpp +++ b/cl_dll/events/event_sawedoff.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::sawedoff { enum sawedoff_e { diff --git a/cl_dll/events/event_scarh.cpp b/cl_dll/events/event_scarh.cpp index adff157c4..a67109fa0 100644 --- a/cl_dll/events/event_scarh.cpp +++ b/cl_dll/events/event_scarh.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::scarh { enum scar_e { diff --git a/cl_dll/events/event_scarl.cpp b/cl_dll/events/event_scarl.cpp index 8ed1a2848..846a6ae7c 100644 --- a/cl_dll/events/event_scarl.cpp +++ b/cl_dll/events/event_scarl.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::scarl { enum scar_e { diff --git a/cl_dll/events/event_scout.cpp b/cl_dll/events/event_scout.cpp index 681cc9e8c..7c42a7b2a 100644 --- a/cl_dll/events/event_scout.cpp +++ b/cl_dll/events/event_scout.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::scout { enum scout_e { diff --git a/cl_dll/events/event_sg550.cpp b/cl_dll/events/event_sg550.cpp index 62711ab55..268671bdb 100644 --- a/cl_dll/events/event_sg550.cpp +++ b/cl_dll/events/event_sg550.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::sg550 { enum sg550_e { diff --git a/cl_dll/events/event_sg552.cpp b/cl_dll/events/event_sg552.cpp index 2c347e7fe..fd937c4d0 100644 --- a/cl_dll/events/event_sg552.cpp +++ b/cl_dll/events/event_sg552.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::sg552 { enum sg552_e { diff --git a/cl_dll/events/event_sgdrill.cpp b/cl_dll/events/event_sgdrill.cpp index 44bd69284..0bade458b 100644 --- a/cl_dll/events/event_sgdrill.cpp +++ b/cl_dll/events/event_sgdrill.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::sgdrill { enum sgdrill_e { diff --git a/cl_dll/events/event_starchaserar.cpp b/cl_dll/events/event_starchaserar.cpp index f4cddf438..6dbe2c7d8 100644 --- a/cl_dll/events/event_starchaserar.cpp +++ b/cl_dll/events/event_starchaserar.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::starchaserar { enum starchaserar_e { diff --git a/cl_dll/events/event_stg44.cpp b/cl_dll/events/event_stg44.cpp index f57a8aa4f..1d0cfd9cd 100644 --- a/cl_dll/events/event_stg44.cpp +++ b/cl_dll/events/event_stg44.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::stg44 { enum stg44_e { diff --git a/cl_dll/events/event_svdex.cpp b/cl_dll/events/event_svdex.cpp index 6e1e7bef3..5b653d736 100644 --- a/cl_dll/events/event_svdex.cpp +++ b/cl_dll/events/event_svdex.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::svdex { enum svdex_e { diff --git a/cl_dll/events/event_tar21.cpp b/cl_dll/events/event_tar21.cpp index 63f8f8e23..2235440d4 100644 --- a/cl_dll/events/event_tar21.cpp +++ b/cl_dll/events/event_tar21.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::tar21 { enum tar21_e { diff --git a/cl_dll/events/event_tbarrel.cpp b/cl_dll/events/event_tbarrel.cpp index aef8ddb09..13c31f37b 100644 --- a/cl_dll/events/event_tbarrel.cpp +++ b/cl_dll/events/event_tbarrel.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::tbarrel { enum tbarrel_e { diff --git a/cl_dll/events/event_tec9.cpp b/cl_dll/events/event_tec9.cpp index a2999d422..8d48c07a3 100644 --- a/cl_dll/events/event_tec9.cpp +++ b/cl_dll/events/event_tec9.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::tec9 { enum tec9_e { diff --git a/cl_dll/events/event_thompson.cpp b/cl_dll/events/event_thompson.cpp index 54db4f70d..0e9385ebd 100644 --- a/cl_dll/events/event_thompson.cpp +++ b/cl_dll/events/event_thompson.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::thompson { enum thompson_e { diff --git a/cl_dll/events/event_tmp.cpp b/cl_dll/events/event_tmp.cpp index dbbf9ef26..6096320ee 100644 --- a/cl_dll/events/event_tmp.cpp +++ b/cl_dll/events/event_tmp.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::tmp { enum tmp_e { diff --git a/cl_dll/events/event_ump45.cpp b/cl_dll/events/event_ump45.cpp index 7f413c27e..47a0b0730 100644 --- a/cl_dll/events/event_ump45.cpp +++ b/cl_dll/events/event_ump45.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::ump45 { enum ump45_e { diff --git a/cl_dll/events/event_usp.cpp b/cl_dll/events/event_usp.cpp index d6993d7f0..e8cddb7cd 100644 --- a/cl_dll/events/event_usp.cpp +++ b/cl_dll/events/event_usp.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::usp { enum usp_e { diff --git a/cl_dll/events/event_vehicle.cpp b/cl_dll/events/event_vehicle.cpp index 126cf091b..ed7d55418 100644 --- a/cl_dll/events/event_vehicle.cpp +++ b/cl_dll/events/event_vehicle.cpp @@ -29,7 +29,7 @@ #include -namespace cl { +namespace cl::event::vehicle { static const char *SOUNDS_NAME[] = { diff --git a/cl_dll/events/event_voidpistol.cpp b/cl_dll/events/event_voidpistol.cpp index 35f92c007..7411757ec 100644 --- a/cl_dll/events/event_voidpistol.cpp +++ b/cl_dll/events/event_voidpistol.cpp @@ -31,8 +31,10 @@ #include namespace cl { + extern engine_studio_api_t IEngineStudio; +} -extern engine_studio_api_t IEngineStudio; +namespace cl::event::voidpistol { enum voidpistol_e { diff --git a/cl_dll/events/event_wa2000.cpp b/cl_dll/events/event_wa2000.cpp index 36c2fc12b..5db2e2e13 100644 --- a/cl_dll/events/event_wa2000.cpp +++ b/cl_dll/events/event_wa2000.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::wa2000 { enum wa2000_e { diff --git a/cl_dll/events/event_xm1014.cpp b/cl_dll/events/event_xm1014.cpp index 9c94a47fd..b34875700 100644 --- a/cl_dll/events/event_xm1014.cpp +++ b/cl_dll/events/event_xm1014.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::xm1014 { enum xm1014_e { diff --git a/cl_dll/events/event_xm2010pc.cpp b/cl_dll/events/event_xm2010pc.cpp index 3bc79cede..b04d323d9 100644 --- a/cl_dll/events/event_xm2010pc.cpp +++ b/cl_dll/events/event_xm2010pc.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::xm2010pc { enum awp_e { diff --git a/cl_dll/events/event_xm8c.cpp b/cl_dll/events/event_xm8c.cpp index f6125560c..c9464f411 100644 --- a/cl_dll/events/event_xm8c.cpp +++ b/cl_dll/events/event_xm8c.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::xm8c { enum xm8_e { diff --git a/cl_dll/events/event_xm8s.cpp b/cl_dll/events/event_xm8s.cpp index 96cb40308..3fd717c33 100644 --- a/cl_dll/events/event_xm8s.cpp +++ b/cl_dll/events/event_xm8s.cpp @@ -27,7 +27,7 @@ */ #include "events.h" -namespace cl { +namespace cl::event::xm8s { enum xm8_e { diff --git a/cl_dll/events/eventdef.h b/cl_dll/events/eventdef.h new file mode 100644 index 000000000..21c461868 --- /dev/null +++ b/cl_dll/events/eventdef.h @@ -0,0 +1,105 @@ +HOOK_EVENT(ak47, FireAK47); +HOOK_EVENT(aug, FireAUG); +HOOK_EVENT(awp, FireAWP); +HOOK_EVENT(createexplo, CreateExplo); +HOOK_EVENT(createsmoke, CreateSmoke); +HOOK_EVENT(deagle, FireDEAGLE); +HOOK_EVENT(decal_reset, DecalReset); +HOOK_EVENT(elite_left, FireEliteLeft); +HOOK_EVENT(elite_right, FireEliteRight); +HOOK_EVENT(famas, FireFAMAS); +HOOK_EVENT(fiveseven, Fire57); +HOOK_EVENT(g3sg1, FireG3SG1); +HOOK_EVENT(galil, FireGALIL); +HOOK_EVENT(glock18, Fireglock18); +HOOK_EVENT(knife, Knife); +HOOK_EVENT(m249, FireM249); +HOOK_EVENT(m3, FireM3); +HOOK_EVENT(m4a1, FireM4A1); +HOOK_EVENT(mac10, FireMAC10); +HOOK_EVENT(mp5n, FireMP5); +HOOK_EVENT(p228, FireP228); +HOOK_EVENT(p90, FireP90); +HOOK_EVENT(scout, FireScout); +HOOK_EVENT(sg550, FireSG550); +HOOK_EVENT(sg552, FireSG552); +HOOK_EVENT(tmp, FireTMP); +HOOK_EVENT(ump45, FireUMP45); +HOOK_EVENT(usp, FireUSP); +HOOK_EVENT(vehicle, Vehicle); +HOOK_EVENT(xm1014, FireXM1014); + +HOOK_EVENT(ak47l, FireAK47L); +HOOK_EVENT(deagled_left, FireDeagleD_Left); +HOOK_EVENT(deagled_right, FireDeagleD_Right); +HOOK_EVENT(mp7a1d_left, FireMP7A1D_Left); +HOOK_EVENT(mp7a1d_right, FireMP7A1D_Right); +HOOK_EVENT(wa2000, FireWA2000); +HOOK_EVENT(m95, FireM95); +HOOK_EVENT(as50, FireAS50); +HOOK_EVENT(kriss, FireKRISS); +HOOK_EVENT(thompson, FireTHOMPSON); +HOOK_EVENT(m1887, FireM1887); +HOOK_EVENT(tar21, FireTAR21); +HOOK_EVENT(xm8c, FireXM8C); +HOOK_EVENT(xm8s, FireXM8S); +HOOK_EVENT(scarh, FireScarH); +HOOK_EVENT(scarl, FireScarL); +HOOK_EVENT(cannon, FireCannon); +HOOK_EVENT(cannonplasma, FireCannonPlasma); +HOOK_EVENT(cannontiger, FireCannonTiger); +HOOK_EVENT(k1a, FireK1a); +HOOK_EVENT(infinity_left, FireInfinity_Left); +HOOK_EVENT(infinity_right, FireInfinity_Right); +HOOK_EVENT(infinityx_left, FireInfinityX_Left); +HOOK_EVENT(infinityx_right, FireInfinityX_Right); +HOOK_EVENT(svdex, FireSVDEX); +HOOK_EVENT(mp7a1c, FireMP7A1C); +HOOK_EVENT(mp7a1p, FireMP7A1P); +HOOK_EVENT(mg3, FireMG3); +HOOK_EVENT(mg3xmas, FireMG3xmas); +HOOK_EVENT(m95xmas, FireM95xmas); +HOOK_EVENT(m4a1dragon, FireM4A1Dragon); +HOOK_EVENT(ak47dragon, FireAK47Dragon); +HOOK_EVENT(knifedragon, KnifeDragon); +HOOK_EVENT(janus7xmas, FireJanus7xmas); +HOOK_EVENT(chainsaw, FireChainsaw); +HOOK_EVENT(desperado, FireDesperado); +HOOK_EVENT(tbarrel, FireTbarrel); +HOOK_EVENT(sgdrill, FireSgdrill); +HOOK_EVENT(m134xmas, FireM134xmas); +HOOK_EVENT(m14ebr, FireM14EBR); +HOOK_EVENT(gatling, FireGatling); +HOOK_EVENT(gatlingex, FireGatlingex); +HOOK_EVENT(bow, FireBow); +HOOK_EVENT(balrog7, FireBalrog7); +HOOK_EVENT(m2, FireM2); +HOOK_EVENT(m134, FireM134); +HOOK_EVENT(m134ex, FireM134ex); +HOOK_EVENT(starchaserar, FireStarchaserar); +HOOK_EVENT(infinityss, FireInfinitySS); +HOOK_EVENT(infinitysb, FireInfinitySB); +HOOK_EVENT(infinitysr, FireInfinitySR); +HOOK_EVENT(gungnir, FireGungnir); +HOOK_EVENT(anaconda, FireAnaconda); +HOOK_EVENT(mg36, FireMG36); +HOOK_EVENT(m134heroi, FireM134HeroI); +HOOK_EVENT(m134heroi_fire, FireM134HeroI_EgonFire); +HOOK_EVENT(m134heroi_stop, FireM134HeroI_EgonStop); +HOOK_EVENT(deagleb, FireDeagleB); +HOOK_EVENT(xm2010pc, FireXM2010PC); +HOOK_EVENT(m4a1razer, FireM4A1Razer); +HOOK_EVENT(m4a1x, FireM4A1X); +HOOK_EVENT(m4a1mw, FireM4A1MW); +HOOK_EVENT(ak47x, FireAK47X); +HOOK_EVENT(negev, FireNegev); +HOOK_EVENT(mag7, FireMag7); +HOOK_EVENT(bizon, FireBizon); +HOOK_EVENT(cz75, FireCz75); +HOOK_EVENT(tec9, FireTec9); +HOOK_EVENT(sawedoff, FireSawedoff); +HOOK_EVENT(gunkata, FireGunkata); +HOOK_EVENT(stg44, FireStg44); +HOOK_EVENT(r8, FireR8); +HOOK_EVENT(voidpistol, FireVoidpistol); +HOOK_EVENT(wpneffects, WpnEffects); \ No newline at end of file diff --git a/cl_dll/events/hl_events.cpp b/cl_dll/events/hl_events.cpp index 36b67b2f5..66ffe1eed 100644 --- a/cl_dll/events/hl_events.cpp +++ b/cl_dll/events/hl_events.cpp @@ -23,111 +23,13 @@ namespace cl { int g_iRShell, g_iPShell, g_iBlackSmoke, g_iShotgunShell; cvar_t *cl_gunbubbles, *cl_tracereffect; - - DECLARE_EVENT(FireAK47); - DECLARE_EVENT(FireAUG); - DECLARE_EVENT(FireAWP); - DECLARE_EVENT(CreateExplo); - DECLARE_EVENT(CreateSmoke); - DECLARE_EVENT(FireDEAGLE); - DECLARE_EVENT(DecalReset); - DECLARE_EVENT(FireEliteLeft); - DECLARE_EVENT(FireEliteRight); - DECLARE_EVENT(FireFAMAS); - DECLARE_EVENT(Fire57); - DECLARE_EVENT(FireG3SG1); - DECLARE_EVENT(FireGALIL); - DECLARE_EVENT(Fireglock18); - DECLARE_EVENT(Knife); - DECLARE_EVENT(FireM249); - DECLARE_EVENT(FireM3); - DECLARE_EVENT(FireM4A1); - DECLARE_EVENT(FireMAC10); - DECLARE_EVENT(FireMP5); - DECLARE_EVENT(FireP228); - DECLARE_EVENT(FireP90); - DECLARE_EVENT(FireScout); - DECLARE_EVENT(FireSG550); - DECLARE_EVENT(FireSG552); - DECLARE_EVENT(FireTMP); - DECLARE_EVENT(FireUMP45); - DECLARE_EVENT(FireUSP); - DECLARE_EVENT(Vehicle); - DECLARE_EVENT(FireXM1014); - DECLARE_EVENT(TrainPitchAdjust); - - DECLARE_EVENT(FireAK47L); - DECLARE_EVENT(FireDeagleD_Left); - DECLARE_EVENT(FireDeagleD_Right); - DECLARE_EVENT(FireMP7A1D_Left); - DECLARE_EVENT(FireMP7A1D_Right); - DECLARE_EVENT(FireWA2000); - DECLARE_EVENT(FireM95); - DECLARE_EVENT(FireM4A1Dragon); - DECLARE_EVENT(FireAK47Dragon); - DECLARE_EVENT(KnifeDragon); - DECLARE_EVENT(FireAS50); - DECLARE_EVENT(FireKRISS); - DECLARE_EVENT(FireTHOMPSON); - DECLARE_EVENT(FireM1887); - DECLARE_EVENT(FireTAR21); - DECLARE_EVENT(FireXM8C); - DECLARE_EVENT(FireXM8S); - DECLARE_EVENT(FireScarH); - DECLARE_EVENT(FireScarL); - DECLARE_EVENT(FireCannon); - DECLARE_EVENT(FireCannonPlasma); - DECLARE_EVENT(FireCannonTiger); - DECLARE_EVENT(FireK1a); - DECLARE_EVENT(FireInfinity_Left); - DECLARE_EVENT(FireInfinity_Right); - DECLARE_EVENT(FireInfinityX_Left); - DECLARE_EVENT(FireInfinityX_Right); - DECLARE_EVENT(FireSVDEX); - DECLARE_EVENT(FireMP7A1C); - DECLARE_EVENT(FireMP7A1P); - DECLARE_EVENT(FireMG3); - DECLARE_EVENT(FireMG3xmas); - DECLARE_EVENT(FireM95xmas); - DECLARE_EVENT(FireJanus7xmas); - DECLARE_EVENT(FireChainsaw); - DECLARE_EVENT(FireDesperado); - DECLARE_EVENT(FireTbarrel); - DECLARE_EVENT(FireSgdrill); - DECLARE_EVENT(FireM134xmas); - DECLARE_EVENT(FireM14EBR); - DECLARE_EVENT(FireGatling); - DECLARE_EVENT(FireGatlingex); - DECLARE_EVENT(FireBow); - DECLARE_EVENT(FireBalrog7); - DECLARE_EVENT(FireM2); - DECLARE_EVENT(FireM134); - DECLARE_EVENT(FireM134ex); - DECLARE_EVENT(FireStarchaserar); - DECLARE_EVENT(FireInfinityS); - DECLARE_EVENT(FireGungnir); - DECLARE_EVENT(FireAnaconda); - DECLARE_EVENT(FireMG36); - DECLARE_EVENT(FireM134HeroI); - DECLARE_EVENT(FireM134HeroI_EgonFire); - DECLARE_EVENT(FireM134HeroI_EgonStop); - DECLARE_EVENT(FireDeagleB); - DECLARE_EVENT(FireXM2010PC); - DECLARE_EVENT(FireM4A1Razer); - DECLARE_EVENT(FireM4A1X); - DECLARE_EVENT(FireM4A1MW); - DECLARE_EVENT(FireAK47X); - DECLARE_EVENT(FireMag7); - DECLARE_EVENT(FireNegev); - DECLARE_EVENT(FireBizon); - DECLARE_EVENT(FireCz75); - DECLARE_EVENT(FireSawedoff); - DECLARE_EVENT(FireTec9); - DECLARE_EVENT(FireStg44); - DECLARE_EVENT(FireR8); - DECLARE_EVENT(FireGunkata); - DECLARE_EVENT(FireVoidpistol); - DECLARE_EVENT(WpnEffects); +#define HOOK_EVENT( x, y ) namespace event::x { \ + void EV_##y( struct event_args_s *args ); \ + } \ + using event::x::EV_##y +#include "eventdef.h" +#undef HOOK_EVENT + /* ====================== Game_HookEvents @@ -143,111 +45,9 @@ That was what we were going to do, but we ran out of time...oh well. */ void Game_HookEvents( void ) { - HOOK_EVENT( ak47, FireAK47 ); - HOOK_EVENT( aug, FireAUG ); - HOOK_EVENT( awp, FireAWP ); - HOOK_EVENT( createexplo, CreateExplo ); - HOOK_EVENT( createsmoke, CreateSmoke ); - HOOK_EVENT( deagle, FireDEAGLE ); - HOOK_EVENT( decal_reset, DecalReset ); - HOOK_EVENT( elite_left, FireEliteLeft ); - HOOK_EVENT( elite_right, FireEliteRight ); - HOOK_EVENT( famas, FireFAMAS ); - HOOK_EVENT( fiveseven, Fire57 ); - HOOK_EVENT( g3sg1, FireG3SG1 ); - HOOK_EVENT( galil, FireGALIL ); - HOOK_EVENT( glock18, Fireglock18 ); - HOOK_EVENT( knife, Knife ); - HOOK_EVENT( m249, FireM249 ); - HOOK_EVENT( m3, FireM3 ); - HOOK_EVENT( m4a1, FireM4A1 ); - HOOK_EVENT( mac10, FireMAC10 ); - HOOK_EVENT( mp5n, FireMP5 ); - HOOK_EVENT( p228, FireP228 ); - HOOK_EVENT( p90, FireP90 ); - HOOK_EVENT( scout, FireScout ); - HOOK_EVENT( sg550, FireSG550 ); - HOOK_EVENT( sg552, FireSG552 ); - HOOK_EVENT( tmp, FireTMP ); - HOOK_EVENT( ump45, FireUMP45 ); - HOOK_EVENT( usp, FireUSP ); - HOOK_EVENT( vehicle, Vehicle ); - HOOK_EVENT( xm1014, FireXM1014 ); - - HOOK_EVENT(ak47l, FireAK47L); - HOOK_EVENT(deagled_left, FireDeagleD_Left); - HOOK_EVENT(deagled_right, FireDeagleD_Right); - HOOK_EVENT(mp7a1d_left, FireMP7A1D_Left); - HOOK_EVENT(mp7a1d_right, FireMP7A1D_Right); - HOOK_EVENT(wa2000, FireWA2000); - HOOK_EVENT(m95, FireM95); - HOOK_EVENT(as50, FireAS50); - HOOK_EVENT(kriss, FireKRISS); - HOOK_EVENT(thompson, FireTHOMPSON); - HOOK_EVENT(m1887, FireM1887); - HOOK_EVENT(tar21, FireTAR21); - HOOK_EVENT(xm8c, FireXM8C); - HOOK_EVENT(xm8s, FireXM8S); - HOOK_EVENT(scarh, FireScarH); - HOOK_EVENT(scarl, FireScarL); - HOOK_EVENT(cannon, FireCannon); - HOOK_EVENT(cannonplasma, FireCannonPlasma); - HOOK_EVENT(cannontiger, FireCannonTiger); - HOOK_EVENT(k1a, FireK1a); - HOOK_EVENT(infinity_left, FireInfinity_Left); - HOOK_EVENT(infinity_right, FireInfinity_Right); - HOOK_EVENT(infinityx_left, FireInfinityX_Left); - HOOK_EVENT(infinityx_right, FireInfinityX_Right); - HOOK_EVENT(svdex, FireSVDEX); - HOOK_EVENT(mp7a1c, FireMP7A1C); - HOOK_EVENT(mp7a1p, FireMP7A1P); - HOOK_EVENT(mg3, FireMG3); - HOOK_EVENT(mg3xmas, FireMG3xmas); - HOOK_EVENT(m95xmas, FireM95xmas); - HOOK_EVENT(m4a1dragon, FireM4A1Dragon); - HOOK_EVENT(ak47dragon, FireAK47Dragon); - HOOK_EVENT(knifedragon, KnifeDragon); - HOOK_EVENT(janus7xmas, FireJanus7xmas); - HOOK_EVENT(chainsaw, FireChainsaw); - HOOK_EVENT(desperado, FireDesperado); - HOOK_EVENT(tbarrel, FireTbarrel); - HOOK_EVENT(sgdrill, FireSgdrill); - HOOK_EVENT(m134xmas, FireM134xmas); - HOOK_EVENT(m14ebr, FireM14EBR); - HOOK_EVENT(gatling, FireGatling); - HOOK_EVENT(gatlingex, FireGatlingex); - HOOK_EVENT(bow, FireBow); - HOOK_EVENT(balrog7, FireBalrog7); - HOOK_EVENT(m2, FireM2); - HOOK_EVENT(m134, FireM134); - HOOK_EVENT(m134ex, FireM134ex); - HOOK_EVENT(starchaserar, FireStarchaserar); - HOOK_EVENT(infinityss, FireInfinityS); - HOOK_EVENT(infinitysb, FireInfinityS); - HOOK_EVENT(infinitysr, FireInfinityS); - HOOK_EVENT(gungnir, FireGungnir); - HOOK_EVENT(anaconda, FireAnaconda); - HOOK_EVENT(mg36, FireMG36); - HOOK_EVENT(m134heroi, FireM134HeroI); - HOOK_EVENT(m134heroi_fire, FireM134HeroI_EgonFire); - HOOK_EVENT(m134heroi_stop, FireM134HeroI_EgonStop); - HOOK_EVENT(deagleb, FireDeagleB); - HOOK_EVENT(xm2010pc, FireXM2010PC); - HOOK_EVENT(m4a1razer, FireM4A1Razer); - HOOK_EVENT(m4a1x, FireM4A1X); - HOOK_EVENT(m4a1mw, FireM4A1MW); - HOOK_EVENT(ak47x, FireAK47X); - HOOK_EVENT(negev, FireNegev); - HOOK_EVENT(mag7, FireMag7); - HOOK_EVENT(bizon, FireBizon); - HOOK_EVENT(cz75, FireCz75); - HOOK_EVENT(tec9, FireTec9); - HOOK_EVENT(sawedoff, FireSawedoff); - HOOK_EVENT(gunkata, FireGunkata); - HOOK_EVENT(stg44, FireStg44); - HOOK_EVENT(r8, FireR8); - HOOK_EVENT(voidpistol, FireVoidpistol); - HOOK_EVENT(wpneffects, WpnEffects); +#define HOOK_EVENT( x, y ) gEngfuncs.pfnHookEvent( "events/" #x ".sc", EV_##y ) +#include "eventdef.h" +#undef HOOK_EVENT #ifdef XASH_LUASH LuaCL_HookEvents(); diff --git a/cl_dll/hud/ammo.cpp b/cl_dll/hud/ammo.cpp index cf619cf61..5a9a21f31 100644 --- a/cl_dll/hud/ammo.cpp +++ b/cl_dll/hud/ammo.cpp @@ -299,9 +299,6 @@ DECLARE_COMMAND(m_Ammo, Autobuy) // width of ammo fonts #define AMMO_SMALL_WIDTH 10 -#define AMMO_LARGE_WIDTH 20 - -#define HISTORY_DRAW_TIME "5" int CHudAmmo::Init(void) { @@ -336,7 +333,7 @@ int CHudAmmo::Init(void) Reset(); - m_pHud_DrawHistory_Time = CVAR_CREATE( "hud_drawhistory_time", HISTORY_DRAW_TIME, 0 ); + m_pHud_DrawHistory_Time = CVAR_CREATE( "hud_drawhistory_time", "5", 0 ); m_pHud_FastSwitch = CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress CVAR_CREATE( "cl_observercrosshair", "1", 0 ); m_pClCrosshairColor = CVAR_CREATE( "cl_crosshair_color", "50 250 50", FCVAR_ARCHIVE ); diff --git a/cl_dll/hud/ammo.h b/cl_dll/hud/ammo.h index 664a81802..037e35068 100644 --- a/cl_dll/hud/ammo.h +++ b/cl_dll/hud/ammo.h @@ -21,6 +21,8 @@ #define WEAPON_FLAGS_SELECTONEMPTY 1 +extern int HISTORY_DRAW_TIME; + struct WEAPON { char szName[MAX_WEAPON_NAME]; diff --git a/cl_dll/input_xash3d.cpp b/cl_dll/input_xash3d.cpp index ff81301b8..bf7914f37 100644 --- a/cl_dll/input_xash3d.cpp +++ b/cl_dll/input_xash3d.cpp @@ -25,16 +25,18 @@ bool bMouseInUse = false; extern Vector dead_viewangles; extern bool evdev_open; -#define F 1U<<0 // Forward -#define B 1U<<1 // Back -#define L 1U<<2 // Left -#define R 1U<<3 // Right -#define T 1U<<4 // Forward stop -#define S 1U<<5 // Side stop +inline namespace input_xash3d { +constexpr auto F = 1U<<0; // Forward +constexpr auto B = 1U<<1; // Back +constexpr auto L = 1U<<2; // Left +constexpr auto R = 1U<<3; // Right +constexpr auto T = 1U<<4; // Forward stop +constexpr auto S = 1U<<5; // Side stop #define BUTTON_DOWN 1 #define IMPULSE_DOWN 2 #define IMPULSE_UP 4 +} bool CL_IsDead(); diff --git a/cl_dll/vgui_parser.cpp b/cl_dll/vgui_parser.cpp index 7c6f49dad..b4d4f0b26 100644 --- a/cl_dll/vgui_parser.cpp +++ b/cl_dll/vgui_parser.cpp @@ -38,16 +38,15 @@ #include // for localized titles.txt strings -using namespace std; using namespace cl; -typedef unordered_map< string, char* > CDict; +typedef std::unordered_map< std::string, char* > CDict; CDict gTitlesTXT; const char *Localize( const char *szStr ) { StripEndNewlineFromString( (char *)szStr ); - auto got = gTitlesTXT.find( string(szStr) ); + auto got = gTitlesTXT.find(std::string(szStr) ); // if iterator points to end, then 'key' not found in dictionary if( got == gTitlesTXT.end() ) @@ -102,7 +101,7 @@ void Localize_Init( ) size_t iLen = strlen( szLocString ) + 1; char *szLocCopyString = new char[iLen]; strncpy(szLocCopyString, szLocString, iLen ); - gTitlesTXT[ string(token) ] = szLocCopyString; + gTitlesTXT[std::string(token) ] = szLocCopyString; } } } diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index d597c178b..90a62e8f9 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -408,3 +408,7 @@ endif() if(XASH_PCH) target_precompile_headers(${SERVER_LIBRARY} PRIVATE stdafx.h) endif() + +if(XASH_UNITY_BUILD) + set_target_properties(${SERVER_LIBRARY} PROPERTIES UNITY_BUILD ON) +endif() diff --git a/dlls/cbase.h b/dlls/cbase.h index 7d21a3c79..122ccb199 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -364,6 +364,8 @@ class CBaseEntity : public PrivateData static TYPEDESCRIPTION m_SaveData[]; }; +inline int FNullEnt(CBaseEntity* ent) { return (!ent) || FNullEnt(ent->edict()); } + } // namespace sv | cl #include "cbase/cbase_memory.h" diff --git a/dlls/cbase/cbase_entity_factory.h b/dlls/cbase/cbase_entity_factory.h index 1a82a6668..9eecab736 100644 --- a/dlls/cbase/cbase_entity_factory.h +++ b/dlls/cbase/cbase_entity_factory.h @@ -50,22 +50,30 @@ template int REMEMBER_TO_ADD_IN_cbase_typelist_h_() { return 2; } } #endif +#ifndef XASH_UNITY_BUILD +#define DECLEAR_ENTITY_CLASS_REMINDER(DLLClassName) template int REMEMBER_TO_ADD_IN_cbase_typelist_h_(); +#define LINK_ENTITY_TO_REMINDER(DLLClassName) extern template int REMEMBER_TO_ADD_IN_cbase_typelist_h_(); +#else +#define DECLEAR_ENTITY_CLASS_REMINDER(DLLClassName) +#define LINK_ENTITY_TO_REMINDER(DLLClassName) +#endif + #ifdef CLIENT_DLL #include "cs_wpn/bte_weapons_register.h" #define DECLEAR_ENTITY_CLASS(DLLClassName) \ class DLLClassName; \ - template int REMEMBER_TO_ADD_IN_cbase_typelist_h_(); \ - extern EntityMetaData GetEntityMetaDataFor(type_identity); + DECLEAR_ENTITY_CLASS_REMINDER(DLLClassName) \ + extern EntityMetaData GetEntityMetaDataFor(type_identity); #define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName) \ - extern template int REMEMBER_TO_ADD_IN_cbase_typelist_h_(); \ + LINK_ENTITY_TO_REMINDER(DLLClassName) \ EntityMetaData GetEntityMetaDataFor(type_identity) { return { REMEMBER_TO_ADD_IN_cbase_typelist_h_(), #mapClassName, WeaponEntityPlaceHolderFactory() }; } #else #define DECLEAR_ENTITY_CLASS(DLLClassName) \ class DLLClassName; \ - template int REMEMBER_TO_ADD_IN_cbase_typelist_h_(); \ - extern EntityMetaData GetEntityMetaDataFor(type_identity); + DECLEAR_ENTITY_CLASS_REMINDER(DLLClassName); \ + extern EntityMetaData GetEntityMetaDataFor(type_identity); #define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName) \ extern "C" EXPORT void mapClassName(entvars_t *pev) { (void)GetClassPtr(pev); } \ - extern template int REMEMBER_TO_ADD_IN_cbase_typelist_h_(); \ + LINK_ENTITY_TO_REMINDER(DLLClassName) \ EntityMetaData GetEntityMetaDataFor(type_identity) { return { REMEMBER_TO_ADD_IN_cbase_typelist_h_(), #mapClassName, &mapClassName }; } #endif diff --git a/dlls/player.cpp b/dlls/player.cpp index 0a47523bb..43cc3c778 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -4686,8 +4686,6 @@ void CBasePlayer::PostThink() // checks if the spot is clear of players -inline int FNullEnt(CBaseEntity *ent) { return (!ent) || FNullEnt(ent->edict()); } - bool CBasePlayer::SelectSpawnSpot(const char *pEntClassName, CBaseEntity *&pSpot) { edict_t *player = edict(); diff --git a/dlls/player/player_msg.cpp b/dlls/player/player_msg.cpp index 7190f49b0..166d0d405 100644 --- a/dlls/player/player_msg.cpp +++ b/dlls/player/player_msg.cpp @@ -112,9 +112,6 @@ DLL_GLOBAL int gmsgZB2Msg = 0; DLL_GLOBAL int gmsgZB3Msg = 0; DLL_GLOBAL int gmsgGunDeath = 0; -// utils -inline int FNullEnt(CBaseEntity *ent) { return (!ent) || FNullEnt(ent->edict()); } - // main code void LinkUserMessages() diff --git a/dlls/player/player_spawnpoint.cpp b/dlls/player/player_spawnpoint.cpp index c57dc9d8d..a70d276c4 100644 --- a/dlls/player/player_spawnpoint.cpp +++ b/dlls/player/player_spawnpoint.cpp @@ -10,9 +10,6 @@ namespace sv { DLL_GLOBAL CBaseEntity *g_pLastSpawn; DLL_GLOBAL CBaseEntity *g_pLastCTSpawn, *g_pLastTerroristSpawn; -// utils -inline int FNullEnt(CBaseEntity *ent) { return (!ent) || FNullEnt(ent->edict()); } - // main code BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot) diff --git a/dlls/training_gamerules.cpp b/dlls/training_gamerules.cpp index 8ee95f23e..17f112994 100644 --- a/dlls/training_gamerules.cpp +++ b/dlls/training_gamerules.cpp @@ -61,8 +61,6 @@ void CHalfLifeTraining::HostageDied() } } -inline int FNullEnt(CBaseEntity *ent) { return (!ent) || FNullEnt(ent->edict()); } - edict_t *CHalfLifeTraining::GetPlayerSpawnSpot(CBasePlayer *pPlayer) { CBaseEntity *pSpot = UTIL_FindEntityByClassname(NULL, "info_player_start"); diff --git a/dlls/weapons/KnifeAttack.h b/dlls/weapons/KnifeAttack.h index 619f097db..2713e7375 100644 --- a/dlls/weapons/KnifeAttack.h +++ b/dlls/weapons/KnifeAttack.h @@ -13,11 +13,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#ifndef PROJECT_KNIFEATTACK_H -#define PROJECT_KNIFEATTACK_H - +#pragma once #ifndef CLIENT_DLL +#include "monsters.h" + namespace sv { void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, const float *pflMins, const float *pfkMaxs, edict_t *pEntity); @@ -294,8 +294,91 @@ KnifeAttack4(Vector vecSrc, Vector vecDir, float flDamage, float flRadius, float return result; } + +inline Vector KnifeAttack2(Vector vecSrc, Vector vecDir, float flDamage, float flRadius, float flAngleDegrees, int bitsDamageType, entvars_t* pevInflictor, entvars_t* pevAttacker) +{ + TraceResult tr; + + const float falloff = flRadius ? flDamage / flRadius : 1; + const int bInWater = (UTIL_PointContents(vecSrc) == CONTENTS_WATER); + + vecSrc.z += 1; + + if (!pevAttacker) + pevAttacker = pevInflictor; + + Vector vecEnd = vecSrc + vecDir.Normalize() * flAngleDegrees; + UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pevAttacker), &tr); + + if (tr.flFraction >= 1) + { + UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT(pevAttacker), &tr); + + if (tr.flFraction < 1) + { + CBaseEntity* pHit = CBaseEntity::Instance(tr.pHit); + + if (pHit && pHit->IsBSPModel() && pHit->pev->takedamage != DAMAGE_NO) + { + float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; + ClearMultiDamage(); + pHit->TraceAttack(pevInflictor, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); + ApplyMultiDamage(pevInflictor, pevAttacker); + } + vecEnd = tr.vecEndPos; + } + } + + CBaseEntity* pEntity = NULL; + while ((pEntity = UTIL_FindEntityInSphere(pEntity, vecSrc, flRadius)) != NULL) + { + if (pEntity->pev->takedamage != DAMAGE_NO) + { + if (bInWater && !pEntity->pev->waterlevel) + continue; + + if (!bInWater && pEntity->pev->waterlevel == 3) + continue; + + if (pEntity->IsBSPModel()) + continue; + + if (pEntity->pev == pevAttacker) + continue; + + Vector vecSpot = pEntity->BodyTarget(vecSrc); + UTIL_TraceLine(vecSrc, vecSpot, missile, ENT(pevInflictor), &tr); + + if (AngleBetweenVectors(tr.vecEndPos - vecSrc, vecDir) > flAngleDegrees) + continue; + + if (tr.flFraction == 1.0f || tr.pHit == pEntity->edict()) + { + if (tr.fStartSolid) + { + tr.vecEndPos = vecSrc; + tr.flFraction = 0; + } + + float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; + flAdjustedDamage = Q_max(0, flAdjustedDamage); + + if (tr.flFraction == 1.0f) + { + pEntity->TakeDamage(pevInflictor, pevAttacker, flAdjustedDamage, bitsDamageType); + } + else + { + tr.iHitgroup = HITGROUP_CHEST; + ClearMultiDamage(); + pEntity->TraceAttack(pevAttacker, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); + ApplyMultiDamage(pevInflictor, pevAttacker); + } + } + } + } + return vecDir; +} } #endif - -#endif //PROJECT_KNIFEATTACK_H diff --git a/dlls/weapons_const.h b/dlls/weapons_const.h index 43a837d65..3757d464a 100644 --- a/dlls/weapons_const.h +++ b/dlls/weapons_const.h @@ -261,4 +261,7 @@ enum BackPrimaryWeapons BACKWEAPON_M4A1_UNSILENCED }; +#define KNIFE_BODYHIT_VOLUME 128 +#define KNIFE_WALLHIT_VOLUME 512 + #endif diff --git a/dlls/wpn_shared/csgo_bizon.cpp b/dlls/wpn_shared/csgo_bizon.cpp index fd1fe8c92..ff68a0815 100644 --- a/dlls/wpn_shared/csgo_bizon.cpp +++ b/dlls/wpn_shared/csgo_bizon.cpp @@ -30,17 +30,6 @@ namespace cl { namespace sv { #endif -enum bizon_e -{ - BIZON_IDLE1, - BIZON_RELOAD, - BIZON_DRAW, - BIZON_SHOOT1, - BIZON_SHOOT2, - BIZON_SHOOT3, - BIZON_INSPECT -}; - LINK_ENTITY_TO_CLASS(csgo_bizon, CBizon) void CBizon::Spawn(void) diff --git a/dlls/wpn_shared/csgo_bizon.h b/dlls/wpn_shared/csgo_bizon.h index 1cd5b1b2c..ea74bdb80 100644 --- a/dlls/wpn_shared/csgo_bizon.h +++ b/dlls/wpn_shared/csgo_bizon.h @@ -1,8 +1,4 @@ -#ifndef WPN_P90_H -#define WPN_P90_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,16 @@ namespace sv { class CBizon : public CBasePlayerWeapon { + enum bizon_e + { + BIZON_IDLE1, + BIZON_RELOAD, + BIZON_DRAW, + BIZON_SHOOT1, + BIZON_SHOOT2, + BIZON_SHOOT3, + BIZON_INSPECT + }; public: void Spawn() override; void Precache() override; @@ -54,5 +60,3 @@ class CBizon : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/csgo_cz75.cpp b/dlls/wpn_shared/csgo_cz75.cpp index 26be9ec86..a04a5367c 100644 --- a/dlls/wpn_shared/csgo_cz75.cpp +++ b/dlls/wpn_shared/csgo_cz75.cpp @@ -29,22 +29,6 @@ namespace cl { namespace sv { #endif -enum cz75_e -{ - CZ75_IDLE_1, - CZ75_IDLE_2, - CZ75_DRAW_1, - CZ75_DRAW_2, - CZ75_SHOOT_1, - CZ75_SHOOT_2, - CZ75_SHOOT_EMPTY_1, - CZ75_SHOOT_EMPTY_2, - CZ75_RELOAD_1, - CZ75_RELOAD_2, - CZ75_INSPECT_1, - CZ75_INSPECT_2 -}; - LINK_ENTITY_TO_CLASS(csgo_cz75, CCz75) void CCz75::Spawn(void) diff --git a/dlls/wpn_shared/csgo_cz75.h b/dlls/wpn_shared/csgo_cz75.h index 03fb7e273..5ca49db10 100644 --- a/dlls/wpn_shared/csgo_cz75.h +++ b/dlls/wpn_shared/csgo_cz75.h @@ -1,8 +1,4 @@ -#ifndef WPN_FIVESEVEN_H -#define WPN_FIVESEVEN_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,21 @@ namespace sv { class CCz75 : public CBasePlayerWeapon { + enum cz75_e + { + CZ75_IDLE_1, + CZ75_IDLE_2, + CZ75_DRAW_1, + CZ75_DRAW_2, + CZ75_SHOOT_1, + CZ75_SHOOT_2, + CZ75_SHOOT_EMPTY_1, + CZ75_SHOOT_EMPTY_2, + CZ75_RELOAD_1, + CZ75_RELOAD_2, + CZ75_INSPECT_1, + CZ75_INSPECT_2 + }; public: void Spawn() override; void Precache() override; @@ -59,5 +70,3 @@ class CCz75 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/csgo_mag7.cpp b/dlls/wpn_shared/csgo_mag7.cpp index 3c38b66ae..8ff509756 100644 --- a/dlls/wpn_shared/csgo_mag7.cpp +++ b/dlls/wpn_shared/csgo_mag7.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum mag7_e -{ - MAG7_IDLE, - MAG7_FIRE1, - MAG7_FIRE2, - MAG7_RELOAD, - MAG7_DRAW, - MAG7_INSPECT, -}; - LINK_ENTITY_TO_CLASS(csgo_mag7, CMag7) void CMag7::Spawn(void) diff --git a/dlls/wpn_shared/csgo_mag7.h b/dlls/wpn_shared/csgo_mag7.h index 4ca617bf7..929126696 100644 --- a/dlls/wpn_shared/csgo_mag7.h +++ b/dlls/wpn_shared/csgo_mag7.h @@ -1,8 +1,4 @@ -#ifndef WPN_XM1014_H -#define WPN_XM1014_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,15 @@ namespace sv { class CMag7 : public CBasePlayerWeapon { + enum mag7_e + { + MAG7_IDLE, + MAG7_FIRE1, + MAG7_FIRE2, + MAG7_RELOAD, + MAG7_DRAW, + MAG7_INSPECT, + }; public: void Spawn() override; void Precache() override; @@ -51,5 +56,3 @@ class CMag7 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/csgo_negev.cpp b/dlls/wpn_shared/csgo_negev.cpp index b24ada13b..5821923e7 100644 --- a/dlls/wpn_shared/csgo_negev.cpp +++ b/dlls/wpn_shared/csgo_negev.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum negev_e -{ - NEGEV_IDLE1, - NEGEV_SHOOT1, - NEGEV_SHOOT2, - NEGEV_RELOAD, - NEGEV_DRAW, - NEGEV_INSPECT -}; - LINK_ENTITY_TO_CLASS(csgo_negev, CNegev) static const int NEGEV_AMMO_GIVE = 150; diff --git a/dlls/wpn_shared/csgo_negev.h b/dlls/wpn_shared/csgo_negev.h index 4a36e4eb0..550d9fdaa 100644 --- a/dlls/wpn_shared/csgo_negev.h +++ b/dlls/wpn_shared/csgo_negev.h @@ -1,8 +1,4 @@ -#ifndef WPN_MG3_H -#define WPN_MG3_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CNegev : public CBasePlayerWeapon { + enum negev_e + { + NEGEV_IDLE1, + NEGEV_SHOOT1, + NEGEV_SHOOT2, + NEGEV_RELOAD, + NEGEV_DRAW, + NEGEV_INSPECT + }; public: void Spawn() override; void Precache() override; @@ -53,5 +58,3 @@ class CNegev : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/csgo_r8.cpp b/dlls/wpn_shared/csgo_r8.cpp index 7c990cb11..d62b35110 100644 --- a/dlls/wpn_shared/csgo_r8.cpp +++ b/dlls/wpn_shared/csgo_r8.cpp @@ -30,25 +30,6 @@ namespace cl { namespace sv { #endif -enum R8_E -{ - IDLE, - DRAW, - DRAW_ALT, - PREPARE, - UNPREPARE, - FIRE, - DRYFIRE, - ALT1, - ALT2, - ALT3, - LOOKAT01, - RELOAD, - LOOKAT01_STICKER, - LOOKAT01_STICKER_LOOP - -}; - LINK_ENTITY_TO_CLASS(csgo_r8, CR8) void CR8::Spawn(void) diff --git a/dlls/wpn_shared/csgo_r8.h b/dlls/wpn_shared/csgo_r8.h index 3b68ac47a..a34a97dc0 100644 --- a/dlls/wpn_shared/csgo_r8.h +++ b/dlls/wpn_shared/csgo_r8.h @@ -1,8 +1,4 @@ -#ifndef WPN_ELITE_H -#define WPN_ELITE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,24 @@ namespace sv { class CR8 : public CBasePlayerWeapon { + enum R8_E + { + IDLE, + DRAW, + DRAW_ALT, + PREPARE, + UNPREPARE, + FIRE, + DRYFIRE, + ALT1, + ALT2, + ALT3, + LOOKAT01, + RELOAD, + LOOKAT01_STICKER, + LOOKAT01_STICKER_LOOP + + }; public: void Spawn() override; void Precache() override; @@ -56,5 +70,3 @@ class CR8 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/csgo_sawedoff.cpp b/dlls/wpn_shared/csgo_sawedoff.cpp index ab171b2f6..aec4cc5b5 100644 --- a/dlls/wpn_shared/csgo_sawedoff.cpp +++ b/dlls/wpn_shared/csgo_sawedoff.cpp @@ -30,18 +30,6 @@ namespace cl { namespace sv { #endif -enum sawedoff_e -{ - SAWEDOFF_IDLE, - SAWEDOFF_FIRE1, - SAWEDOFF_FIRE2, - SAWEDOFF_RELOAD, - SAWEDOFF_PUMP, - SAWEDOFF_START_RELOAD, - SAWEDOFF_DRAW, - SAWEDOFF_INSPECT -}; - LINK_ENTITY_TO_CLASS(csgo_sawedoff, CSawedoff) void CSawedoff::Spawn(void) diff --git a/dlls/wpn_shared/csgo_sawedoff.h b/dlls/wpn_shared/csgo_sawedoff.h index 6fdc6cca8..70bb9ae13 100644 --- a/dlls/wpn_shared/csgo_sawedoff.h +++ b/dlls/wpn_shared/csgo_sawedoff.h @@ -1,8 +1,4 @@ -#ifndef WPN_M3_H -#define WPN_M3_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,17 @@ namespace sv { class CSawedoff : public CBasePlayerWeapon { + enum sawedoff_e + { + SAWEDOFF_IDLE, + SAWEDOFF_FIRE1, + SAWEDOFF_FIRE2, + SAWEDOFF_RELOAD, + SAWEDOFF_PUMP, + SAWEDOFF_START_RELOAD, + SAWEDOFF_DRAW, + SAWEDOFF_INSPECT + }; public: void Spawn() override; void Precache() override; @@ -51,5 +58,3 @@ class CSawedoff : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/csgo_tec9.cpp b/dlls/wpn_shared/csgo_tec9.cpp index 75856a1ce..a2b6b94c5 100644 --- a/dlls/wpn_shared/csgo_tec9.cpp +++ b/dlls/wpn_shared/csgo_tec9.cpp @@ -30,18 +30,6 @@ namespace cl { namespace sv { #endif -enum tec9_e -{ - TEC9_IDLE, - TEC9_RELOAD, - TEC9_DRAW, - TEC9_SHOOT1, - TEC9_SHOOT2, - TEC9_SHOOT3, - TEC9_INSPECT - -}; - LINK_ENTITY_TO_CLASS(csgo_tec9, CTec9) void CTec9::Spawn(void) diff --git a/dlls/wpn_shared/csgo_tec9.h b/dlls/wpn_shared/csgo_tec9.h index 52cb8f95f..6efcda50a 100644 --- a/dlls/wpn_shared/csgo_tec9.h +++ b/dlls/wpn_shared/csgo_tec9.h @@ -1,8 +1,4 @@ -#ifndef WPN_ELITE_H -#define WPN_ELITE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,17 @@ namespace sv { class CTec9 : public CBasePlayerWeapon { + enum tec9_e + { + TEC9_IDLE, + TEC9_RELOAD, + TEC9_DRAW, + TEC9_SHOOT1, + TEC9_SHOOT2, + TEC9_SHOOT3, + TEC9_INSPECT + + }; public: void Spawn() override; void Precache() override; @@ -51,5 +58,3 @@ class CTec9 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/csgo_zeus.cpp b/dlls/wpn_shared/csgo_zeus.cpp index 91dc0803d..079840211 100644 --- a/dlls/wpn_shared/csgo_zeus.cpp +++ b/dlls/wpn_shared/csgo_zeus.cpp @@ -31,12 +31,6 @@ namespace cl { namespace sv { #endif -enum zeus_e -{ - ANIM_IDLE, - ANIM_SHOOT, - ANIM_DRAW -}; #ifndef CLIENT_DLL hit_result_t CZeus::ZeusAttack(Vector vecSrc, Vector vecDir, float flDamage, float flRadius, int bitsDamageType, entvars_t* pevInflictor, entvars_t* pevAttacker) diff --git a/dlls/wpn_shared/csgo_zeus.h b/dlls/wpn_shared/csgo_zeus.h index 1c80cf07f..1c4d732a4 100644 --- a/dlls/wpn_shared/csgo_zeus.h +++ b/dlls/wpn_shared/csgo_zeus.h @@ -1,8 +1,4 @@ -#ifndef WPN_SCOUT_H -#define WPN_SCOUT_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -13,6 +9,12 @@ namespace sv { class CZeus : public CBasePlayerWeapon { + enum zeus_e + { + ANIM_IDLE, + ANIM_SHOOT, + ANIM_DRAW + }; public: void Spawn() override; void Precache() override; @@ -52,5 +54,3 @@ public:; }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/knife_dragonsword.cpp b/dlls/wpn_shared/knife_dragonsword.cpp index 0b9cb63c6..374852e4f 100644 --- a/dlls/wpn_shared/knife_dragonsword.cpp +++ b/dlls/wpn_shared/knife_dragonsword.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeDragonsword : public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/knife_dualsword.cpp b/dlls/wpn_shared/knife_dualsword.cpp index a386eb7b9..0fbde69c2 100644 --- a/dlls/wpn_shared/knife_dualsword.cpp +++ b/dlls/wpn_shared/knife_dualsword.cpp @@ -34,9 +34,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeDualsword: public LinkWeaponTemplate::template type diff --git a/dlls/wpn_shared/knife_katana.cpp b/dlls/wpn_shared/knife_katana.cpp index 03b3353bb..0f53f28ff 100644 --- a/dlls/wpn_shared/knife_katana.cpp +++ b/dlls/wpn_shared/knife_katana.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeKatana: public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/knife_skullaxe.cpp b/dlls/wpn_shared/knife_skullaxe.cpp index 6d669a423..d98b9c7e8 100644 --- a/dlls/wpn_shared/knife_skullaxe.cpp +++ b/dlls/wpn_shared/knife_skullaxe.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeSkullAxe: public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/knife_zombi.cpp b/dlls/wpn_shared/knife_zombi.cpp index b35316bff..170b137da 100644 --- a/dlls/wpn_shared/knife_zombi.cpp +++ b/dlls/wpn_shared/knife_zombi.cpp @@ -26,11 +26,19 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnife_Zombi : public CKnife { + enum knife_e + { + KNIFE_IDLE, + KNIFE_ATTACK1HIT, + KNIFE_ATTACK2HIT, + KNIFE_DRAW, + KNIFE_STABHIT, + KNIFE_STABMISS, + KNIFE_MIDATTACK1HIT, + KNIFE_MIDATTACK2HIT + }; public: void Precache() override; int GetItemInfo(ItemInfo *p) override; @@ -55,18 +63,6 @@ class CKnife_Zombi : public CKnife LINK_ENTITY_TO_CLASS(knife_zombi, CKnife_Zombi) -enum knife_e -{ - KNIFE_IDLE, - KNIFE_ATTACK1HIT, - KNIFE_ATTACK2HIT, - KNIFE_DRAW, - KNIFE_STABHIT, - KNIFE_STABMISS, - KNIFE_MIDATTACK1HIT, - KNIFE_MIDATTACK2HIT -}; - void CKnife_Zombi::Precache(void) { PRECACHE_MODEL("models/v_knife_zombi.mdl"); diff --git a/dlls/wpn_shared/wpn_ak47.cpp b/dlls/wpn_shared/wpn_ak47.cpp index 1729b903a..921d1b761 100644 --- a/dlls/wpn_shared/wpn_ak47.cpp +++ b/dlls/wpn_shared/wpn_ak47.cpp @@ -29,17 +29,6 @@ namespace cl { #else namespace sv { #endif - -enum ak47_e -{ - AK47_IDLE1, - AK47_RELOAD, - AK47_DRAW, - AK47_SHOOT1, - AK47_SHOOT2, - AK47_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_ak47, CAK47) void CAK47::Spawn(void) diff --git a/dlls/wpn_shared/wpn_ak47.h b/dlls/wpn_shared/wpn_ak47.h index 591445032..62ba2de12 100644 --- a/dlls/wpn_shared/wpn_ak47.h +++ b/dlls/wpn_shared/wpn_ak47.h @@ -1,9 +1,4 @@ -#ifndef WPN_AK47_H -#define WPN_AK47_H -#ifdef _WIN32 #pragma once -#endif - //AK47 #define AK47_MAX_SPEED 221 #define AK47_DAMAGE 36 @@ -19,6 +14,15 @@ namespace sv { class CAK47 : public CBasePlayerWeapon { + enum ak47_e + { + AK47_IDLE1, + AK47_RELOAD, + AK47_DRAW, + AK47_SHOOT1, + AK47_SHOOT2, + AK47_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -54,5 +58,3 @@ class CAK47 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_ak47dragon.cpp b/dlls/wpn_shared/wpn_ak47dragon.cpp index 2bbf56af4..9b0eef486 100644 --- a/dlls/wpn_shared/wpn_ak47dragon.cpp +++ b/dlls/wpn_shared/wpn_ak47dragon.cpp @@ -30,17 +30,6 @@ namespace cl { namespace sv { #endif -enum ak47_e -{ - AK47_IDLE1, - AK47_RELOAD, - AK47_DRAW, - AK47_SHOOT1, - AK47_SHOOT2, - AK47_SHOOT3, - AK47_RELOADD, -}; - LINK_ENTITY_TO_CLASS(weapon_ak47dragon, CAK47Dragon) void CAK47Dragon::Spawn(void) diff --git a/dlls/wpn_shared/wpn_ak47dragon.h b/dlls/wpn_shared/wpn_ak47dragon.h index 45f850b11..9effee8cb 100644 --- a/dlls/wpn_shared/wpn_ak47dragon.h +++ b/dlls/wpn_shared/wpn_ak47dragon.h @@ -1,8 +1,4 @@ -#ifndef WPN_AK47_H -#define WPN_AK47_H -#ifdef _WIN32 #pragma once -#endif //AK47 #define AK47_MAX_SPEED 221 @@ -18,6 +14,16 @@ namespace sv { class CAK47Dragon : public CBasePlayerWeapon { + enum ak47_e + { + AK47_IDLE1, + AK47_RELOAD, + AK47_DRAW, + AK47_SHOOT1, + AK47_SHOOT2, + AK47_SHOOT3, + AK47_RELOADD, + }; public: void Spawn() override; void Precache() override; @@ -51,5 +57,3 @@ class CAK47Dragon : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_ak47l.cpp b/dlls/wpn_shared/wpn_ak47l.cpp index ea8411abd..e5190fb60 100644 --- a/dlls/wpn_shared/wpn_ak47l.cpp +++ b/dlls/wpn_shared/wpn_ak47l.cpp @@ -27,16 +27,6 @@ namespace cl { namespace sv { #endif -enum ak47_e -{ - AK47_IDLE1, - AK47_RELOAD, - AK47_DRAW, - AK47_SHOOT1, - AK47_SHOOT2, - AK47_SHOOT3 -}; - class CAK47_Long : public LinkWeaponTemplate::template type, @@ -51,6 +41,15 @@ class CAK47_Long : public LinkWeaponTemplate { + enum ak47_e + { + AK47_IDLE1, + AK47_RELOAD, + AK47_DRAW, + AK47_SHOOT1, + AK47_SHOOT2, + AK47_SHOOT3 + }; public: static constexpr const auto &DefaultReloadTime = 2.45s; static constexpr int ZoomFOV = 55; diff --git a/dlls/wpn_shared/wpn_as50.cpp b/dlls/wpn_shared/wpn_as50.cpp index bcc2c2134..7004f39ff 100644 --- a/dlls/wpn_shared/wpn_as50.cpp +++ b/dlls/wpn_shared/wpn_as50.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum as50_e -{ - AS50_IDLE, - AS50_SHOOT1, - AS50_SHOOT2, - AS50_SHOOT3, - AS50_RELOAD, - AS50_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_as50, CAS50) const int AS50_MAXCLIP = 5; diff --git a/dlls/wpn_shared/wpn_as50.h b/dlls/wpn_shared/wpn_as50.h index fa32f913f..d9959b9c6 100644 --- a/dlls/wpn_shared/wpn_as50.h +++ b/dlls/wpn_shared/wpn_as50.h @@ -1,8 +1,4 @@ -#ifndef WPN_AS50_H -#define WPN_AS50_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,15 @@ namespace sv { class CAS50 : public CBasePlayerWeapon { + enum as50_e + { + AS50_IDLE, + AS50_SHOOT1, + AS50_SHOOT2, + AS50_SHOOT3, + AS50_RELOAD, + AS50_DRAW + }; public: void Spawn() override; void Precache() override; @@ -56,5 +61,3 @@ class CAS50 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_aug.cpp b/dlls/wpn_shared/wpn_aug.cpp index 5f256b3a8..e6af6c2f4 100644 --- a/dlls/wpn_shared/wpn_aug.cpp +++ b/dlls/wpn_shared/wpn_aug.cpp @@ -30,19 +30,6 @@ namespace cl { namespace sv { #endif -enum aug_e -{ - AUG_IDLE1, - AUG_RELOAD, - AUG_DRAW, - AUG_SHOOT1, - AUG_SHOOT2, - AUG_SHOOT3, - AUG_INSPECT, - AUG_AIM, - AUG_BACK -}; - LINK_ENTITY_TO_CLASS(weapon_aug, CAUG) void CAUG::Spawn(void) diff --git a/dlls/wpn_shared/wpn_aug.h b/dlls/wpn_shared/wpn_aug.h index c4aec313e..43c8ba5d1 100644 --- a/dlls/wpn_shared/wpn_aug.h +++ b/dlls/wpn_shared/wpn_aug.h @@ -1,8 +1,4 @@ -#ifndef WPN_AUG_H -#define WPN_AUG_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,18 @@ namespace sv { class CAUG : public CBasePlayerWeapon { + enum aug_e + { + AUG_IDLE1, + AUG_RELOAD, + AUG_DRAW, + AUG_SHOOT1, + AUG_SHOOT2, + AUG_SHOOT3, + AUG_INSPECT, + AUG_AIM, + AUG_BACK + }; public: void Spawn() override; void Precache() override; @@ -57,5 +65,3 @@ class CAUG : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_awp.cpp b/dlls/wpn_shared/wpn_awp.cpp index 4c8d13da0..b9da40b8c 100644 --- a/dlls/wpn_shared/wpn_awp.cpp +++ b/dlls/wpn_shared/wpn_awp.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum awp_e -{ - AWP_IDLE, - AWP_SHOOT1, - AWP_SHOOT2, - AWP_SHOOT3, - AWP_RELOAD, - AWP_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_awp, CAWP) void CAWP::Spawn(void) diff --git a/dlls/wpn_shared/wpn_awp.h b/dlls/wpn_shared/wpn_awp.h index d300d3085..f4e005d95 100644 --- a/dlls/wpn_shared/wpn_awp.h +++ b/dlls/wpn_shared/wpn_awp.h @@ -1,8 +1,4 @@ -#ifndef WPN_AWP_H -#define WPN_AWP_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,15 @@ namespace sv { class CAWP : public CBasePlayerWeapon { + enum awp_e + { + AWP_IDLE, + AWP_SHOOT1, + AWP_SHOOT2, + AWP_SHOOT3, + AWP_RELOAD, + AWP_DRAW + }; public: void Spawn() override; void Precache() override; @@ -53,5 +58,3 @@ class CAWP : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_balrog7.cpp b/dlls/wpn_shared/wpn_balrog7.cpp index 119d91daa..9f6c97cef 100644 --- a/dlls/wpn_shared/wpn_balrog7.cpp +++ b/dlls/wpn_shared/wpn_balrog7.cpp @@ -104,15 +104,6 @@ class CBalrog7Explosion : public CBaseEntity LINK_ENTITY_TO_CLASS(balrog7_explosion, CBalrog7Explosion); #endif -enum balrog7_e -{ - BALROG7_IDLE1, - BALROG7_SHOOT1, - BALROG7_SHOOT2, - BALROG7_SHOOT3, - BALROG7_RELOAD, - BALROG7_DRAW -}; LINK_ENTITY_TO_CLASS(weapon_balrog7, CBalrog7) diff --git a/dlls/wpn_shared/wpn_balrog7.h b/dlls/wpn_shared/wpn_balrog7.h index 29c72f92e..a3b137230 100644 --- a/dlls/wpn_shared/wpn_balrog7.h +++ b/dlls/wpn_shared/wpn_balrog7.h @@ -1,8 +1,4 @@ -#ifndef WPN_BALROG7_H -#define WPN_BALROG7_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,16 @@ namespace sv { class CBalrog7 : public CBasePlayerWeapon { + enum balrog7_e + { + BALROG7_IDLE1, + BALROG7_SHOOT1, + BALROG7_SHOOT2, + BALROG7_SHOOT3, + BALROG7_RELOAD, + BALROG7_DRAW + }; + public: void Spawn() override; void Precache() override; @@ -62,5 +68,3 @@ class CBalrog7 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_bow.cpp b/dlls/wpn_shared/wpn_bow.cpp index 5fa9a5d1a..f9db5c266 100644 --- a/dlls/wpn_shared/wpn_bow.cpp +++ b/dlls/wpn_shared/wpn_bow.cpp @@ -220,24 +220,6 @@ namespace sv { LINK_ENTITY_TO_CLASS(bow_arrow, CBowArrow); #endif -enum bow_e -{ - ANIM_IDLE, - ANIM_IDLE_EMPTY, - ANIM_SHOOT1, - ANIM_SHOOT1_EMPTY, - ANIM_DRAW, - ANIM_DRAW_EMPTY, - ANIM_CHARGE_START1, - ANIM_CHARGE_FINISH1, - ANIM_CHARGE_IDLE1, - ANIM_CHARGE_IDLE2, - ANIM_CHARGE_SHOOT1, - ANIM_CHARGE_SHOOT1_EMPTY, - ANIM_CHARGE_SHOOT2, - ANIM_CHARGE_SHOOT2_EMPTY -}; - LINK_ENTITY_TO_CLASS(weapon_bow, CBow) void CBow::Spawn(void) diff --git a/dlls/wpn_shared/wpn_bow.h b/dlls/wpn_shared/wpn_bow.h index efb128134..554f59f52 100644 --- a/dlls/wpn_shared/wpn_bow.h +++ b/dlls/wpn_shared/wpn_bow.h @@ -1,8 +1,4 @@ -#ifndef WPN_M249_H -#define WPN_M249_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -14,6 +10,23 @@ namespace sv { class CBow : public CBasePlayerWeapon { + enum bow_e + { + ANIM_IDLE, + ANIM_IDLE_EMPTY, + ANIM_SHOOT1, + ANIM_SHOOT1_EMPTY, + ANIM_DRAW, + ANIM_DRAW_EMPTY, + ANIM_CHARGE_START1, + ANIM_CHARGE_FINISH1, + ANIM_CHARGE_IDLE1, + ANIM_CHARGE_IDLE2, + ANIM_CHARGE_SHOOT1, + ANIM_CHARGE_SHOOT1_EMPTY, + ANIM_CHARGE_SHOOT2, + ANIM_CHARGE_SHOOT2_EMPTY + }; public: void Spawn() override; void Precache() override; @@ -59,5 +72,3 @@ class CBow : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_c4.cpp b/dlls/wpn_shared/wpn_c4.cpp index 26f1472ad..b70376dfc 100644 --- a/dlls/wpn_shared/wpn_c4.cpp +++ b/dlls/wpn_shared/wpn_c4.cpp @@ -33,14 +33,6 @@ namespace sv { extern bool g_bInBombZone; #endif -enum c4_e -{ - C4_IDLE1, - C4_DRAW, - C4_DROP, - C4_ARM -}; - LINK_ENTITY_TO_CLASS(weapon_c4, CC4) void CC4::Spawn(void) diff --git a/dlls/wpn_shared/wpn_c4.h b/dlls/wpn_shared/wpn_c4.h index 77f1b40d4..da422233d 100644 --- a/dlls/wpn_shared/wpn_c4.h +++ b/dlls/wpn_shared/wpn_c4.h @@ -1,8 +1,4 @@ -#ifndef WPN_C4_H -#define WPN_C4_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -17,6 +13,13 @@ namespace sv { class CC4 : public CBasePlayerWeapon { + enum c4_e + { + C4_IDLE1, + C4_DRAW, + C4_DROP, + C4_ARM + }; public: virtual void Spawn(); virtual void Precache(); @@ -48,5 +51,3 @@ class CC4 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_cannon.cpp b/dlls/wpn_shared/wpn_cannon.cpp index 97bcfa944..fe8b0c561 100644 --- a/dlls/wpn_shared/wpn_cannon.cpp +++ b/dlls/wpn_shared/wpn_cannon.cpp @@ -19,10 +19,10 @@ GNU General Public License for more details. #include "player.h" #include "weapons.h" #include "wpn_cannon.h" +#include "weapons/KnifeAttack.h" #ifndef CLIENT_DLL #include "soundent.h" -#include "monsters.h" #include "gamemode/mods.h" #endif @@ -34,92 +34,7 @@ namespace sv { LINK_ENTITY_TO_CLASS(weapon_cannon, CCannon) -#ifndef CLIENT_DLL -static inline Vector KnifeAttack2(Vector vecSrc, Vector vecDir, float flDamage, float flRadius, float flAngleDegrees, int bitsDamageType, entvars_t *pevInflictor, entvars_t *pevAttacker) -{ - TraceResult tr; - - const float falloff = flRadius ? flDamage / flRadius : 1; - const int bInWater = (UTIL_PointContents(vecSrc) == CONTENTS_WATER); - - vecSrc.z += 1; - - if (!pevAttacker) - pevAttacker = pevInflictor; - - Vector vecEnd = vecSrc + vecDir.Normalize() * flAngleDegrees; - UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pevAttacker), &tr); - - if (tr.flFraction >= 1) - { - UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT(pevAttacker), &tr); - - if (tr.flFraction < 1) - { - CBaseEntity *pHit = CBaseEntity::Instance(tr.pHit); - - if (pHit && pHit->IsBSPModel() && pHit->pev->takedamage != DAMAGE_NO) - { - float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; - ClearMultiDamage(); - pHit->TraceAttack(pevInflictor, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - } - vecEnd = tr.vecEndPos; - } - } - CBaseEntity *pEntity = NULL; - while ((pEntity = UTIL_FindEntityInSphere(pEntity, vecSrc, flRadius)) != NULL) - { - if (pEntity->pev->takedamage != DAMAGE_NO) - { - if (bInWater && !pEntity->pev->waterlevel) - continue; - - if (!bInWater && pEntity->pev->waterlevel == 3) - continue; - - if (pEntity->IsBSPModel()) - continue; - - if (pEntity->pev == pevAttacker) - continue; - - Vector vecSpot = pEntity->BodyTarget(vecSrc); - UTIL_TraceLine(vecSrc, vecSpot, missile, ENT(pevInflictor), &tr); - - if (AngleBetweenVectors(tr.vecEndPos - vecSrc, vecDir) > flAngleDegrees) - continue; - - if (tr.flFraction == 1.0f || tr.pHit == pEntity->edict()) - { - if (tr.fStartSolid) - { - tr.vecEndPos = vecSrc; - tr.flFraction = 0; - } - - float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; - flAdjustedDamage = Q_max(0, flAdjustedDamage); - - if (tr.flFraction == 1.0f) - { - pEntity->TakeDamage(pevInflictor, pevAttacker, flAdjustedDamage, bitsDamageType); - } - else - { - tr.iHitgroup = HITGROUP_CHEST; - ClearMultiDamage(); - pEntity->TraceAttack(pevAttacker, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - } - } - } - } - return vecDir; -} -#endif void CCannon::Spawn(void) { diff --git a/dlls/wpn_shared/wpn_chainsaw.cpp b/dlls/wpn_shared/wpn_chainsaw.cpp index f8214220b..82c69a625 100644 --- a/dlls/wpn_shared/wpn_chainsaw.cpp +++ b/dlls/wpn_shared/wpn_chainsaw.cpp @@ -31,22 +31,6 @@ namespace cl { namespace sv { #endif -enum chainsaw_e -{ - ANIM_IDLE, - ANIM_DRAW, - ANIM_DRAW_EMPTY, - ANIM_ATTACK_BEGIN, - ANIM_ATTACK_LOOP, - ANIM_ATTACK_END, - ANIM_RELOAD, - ANIM_SLASH1, - ANIM_SLASH2, - ANIM_SLASH3, - ANIM_SLASH4, - ANIM_IDLE_EMPTY -}; - LINK_ENTITY_TO_CLASS(weapon_chainsaw, CChainsaw) void CChainsaw::Spawn(void) diff --git a/dlls/wpn_shared/wpn_chainsaw.h b/dlls/wpn_shared/wpn_chainsaw.h index 119b91ea6..56f575be4 100644 --- a/dlls/wpn_shared/wpn_chainsaw.h +++ b/dlls/wpn_shared/wpn_chainsaw.h @@ -1,8 +1,4 @@ -#ifndef WPN_SCOUT_H -#define WPN_SCOUT_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -24,6 +20,21 @@ namespace sv { class CChainsaw : public CBasePlayerWeapon { + enum chainsaw_e + { + ANIM_IDLE, + ANIM_DRAW, + ANIM_DRAW_EMPTY, + ANIM_ATTACK_BEGIN, + ANIM_ATTACK_LOOP, + ANIM_ATTACK_END, + ANIM_RELOAD, + ANIM_SLASH1, + ANIM_SLASH2, + ANIM_SLASH3, + ANIM_SLASH4, + ANIM_IDLE_EMPTY + }; public: void Spawn() override; void Precache() override; @@ -67,5 +78,3 @@ public:; }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_deagle.cpp b/dlls/wpn_shared/wpn_deagle.cpp index 2b66ca3b3..eae487b84 100644 --- a/dlls/wpn_shared/wpn_deagle.cpp +++ b/dlls/wpn_shared/wpn_deagle.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum deagle_e -{ - DEAGLE_IDLE1, - DEAGLE_SHOOT1, - DEAGLE_SHOOT2, - DEAGLE_SHOOT_EMPTY, - DEAGLE_RELOAD, - DEAGLE_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_deagle, CDEAGLE) void CDEAGLE::Spawn(void) diff --git a/dlls/wpn_shared/wpn_deagle.h b/dlls/wpn_shared/wpn_deagle.h index 3401ddb7d..6a9a60b78 100644 --- a/dlls/wpn_shared/wpn_deagle.h +++ b/dlls/wpn_shared/wpn_deagle.h @@ -1,8 +1,4 @@ -#ifndef WPN_DEAGLE_H -#define WPN_DEAGLE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CDEAGLE : public CBasePlayerWeapon { + enum deagle_e + { + DEAGLE_IDLE1, + DEAGLE_SHOOT1, + DEAGLE_SHOOT2, + DEAGLE_SHOOT_EMPTY, + DEAGLE_RELOAD, + DEAGLE_DRAW + }; public: void Spawn() override; void Precache() override; @@ -53,5 +58,3 @@ class CDEAGLE : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_deagled.cpp b/dlls/wpn_shared/wpn_deagled.cpp index 9647b7486..a387bcbdd 100644 --- a/dlls/wpn_shared/wpn_deagled.cpp +++ b/dlls/wpn_shared/wpn_deagled.cpp @@ -26,26 +26,6 @@ namespace cl { namespace sv { #endif -enum elite_e -{ - ELITE_IDLE, - ELITE_IDLE_LEFTEMPTY, - ELITE_SHOOTLEFT1, - ELITE_SHOOTLEFT2, - ELITE_SHOOTLEFT3, - ELITE_SHOOTLEFT4, - ELITE_SHOOTLEFT5, - ELITE_SHOOTLEFTLAST, - ELITE_SHOOTRIGHT1, - ELITE_SHOOTRIGHT2, - ELITE_SHOOTRIGHT3, - ELITE_SHOOTRIGHT4, - ELITE_SHOOTRIGHT5, - ELITE_SHOOTRIGHTLAST, - ELITE_RELOAD, - ELITE_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_deagled, CDeagleD) const int DEAGLED_MAXCLIP = 28; diff --git a/dlls/wpn_shared/wpn_deagled.h b/dlls/wpn_shared/wpn_deagled.h index 19792d45d..3f750d350 100644 --- a/dlls/wpn_shared/wpn_deagled.h +++ b/dlls/wpn_shared/wpn_deagled.h @@ -1,8 +1,4 @@ -#ifndef WPN_DEAGLED_H -#define WPN_DEAGLED_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -12,6 +8,25 @@ namespace sv { class CDeagleD : public CBasePlayerWeapon { + enum elite_e + { + ELITE_IDLE, + ELITE_IDLE_LEFTEMPTY, + ELITE_SHOOTLEFT1, + ELITE_SHOOTLEFT2, + ELITE_SHOOTLEFT3, + ELITE_SHOOTLEFT4, + ELITE_SHOOTLEFT5, + ELITE_SHOOTLEFTLAST, + ELITE_SHOOTRIGHT1, + ELITE_SHOOTRIGHT2, + ELITE_SHOOTRIGHT3, + ELITE_SHOOTRIGHT4, + ELITE_SHOOTRIGHT5, + ELITE_SHOOTRIGHTLAST, + ELITE_RELOAD, + ELITE_DRAW + }; public: void Spawn() override; void Precache() override; @@ -48,5 +63,3 @@ class CDeagleD : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_desperado.cpp b/dlls/wpn_shared/wpn_desperado.cpp index a96de9bd5..bfc8554fa 100644 --- a/dlls/wpn_shared/wpn_desperado.cpp +++ b/dlls/wpn_shared/wpn_desperado.cpp @@ -31,26 +31,6 @@ namespace cl { namespace sv { #endif -enum desperado_e -{ - ANIM_IDLE_M = 0, - ANIM_RUN_START_M, - ANIM_RUN_IDLE_M, - ANIM_RUN_END_M, - ANIM_DRAW_M, - ANIM_SHOOT_M, - ANIM_RELOAD_M, - ANIM_SWAB_M, // Gold - ANIM_IDLE_W, - ANIM_RUN_START_W, - ANIM_RUN_IDLE_W, - ANIM_RUN_END_W, - ANIM_DRAW_W, - ANIM_SHOOT_W, - ANIM_RELOAD_W, - ANIM_SWAB_W // Blue -}; - LINK_ENTITY_TO_CLASS(weapon_desperado, CDesperado) void CDesperado::Spawn(void) diff --git a/dlls/wpn_shared/wpn_desperado.h b/dlls/wpn_shared/wpn_desperado.h index 58dda7193..af2979915 100644 --- a/dlls/wpn_shared/wpn_desperado.h +++ b/dlls/wpn_shared/wpn_desperado.h @@ -1,8 +1,4 @@ -#ifndef WPN_DESPERADO_H -#define WPN_DESPERADO_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,6 +12,25 @@ namespace sv { class CDesperado : public CBasePlayerWeapon { + enum desperado_e + { + ANIM_IDLE_M = 0, + ANIM_RUN_START_M, + ANIM_RUN_IDLE_M, + ANIM_RUN_END_M, + ANIM_DRAW_M, + ANIM_SHOOT_M, + ANIM_RELOAD_M, + ANIM_SWAB_M, // Gold + ANIM_IDLE_W, + ANIM_RUN_START_W, + ANIM_RUN_IDLE_W, + ANIM_RUN_END_W, + ANIM_DRAW_W, + ANIM_SHOOT_W, + ANIM_RELOAD_W, + ANIM_SWAB_W // Blue + }; public: void Spawn() override; void Precache() override; @@ -62,5 +77,3 @@ class CDesperado : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_elite.cpp b/dlls/wpn_shared/wpn_elite.cpp index 31473d3c5..ecb8aed3d 100644 --- a/dlls/wpn_shared/wpn_elite.cpp +++ b/dlls/wpn_shared/wpn_elite.cpp @@ -30,26 +30,6 @@ namespace cl { namespace sv { #endif -enum elite_e -{ - ELITE_IDLE, - ELITE_IDLE_LEFTEMPTY, - ELITE_SHOOTLEFT1, - ELITE_SHOOTLEFT2, - ELITE_SHOOTLEFT3, - ELITE_SHOOTLEFT4, - ELITE_SHOOTLEFT5, - ELITE_SHOOTLEFTLAST, - ELITE_SHOOTRIGHT1, - ELITE_SHOOTRIGHT2, - ELITE_SHOOTRIGHT3, - ELITE_SHOOTRIGHT4, - ELITE_SHOOTRIGHT5, - ELITE_SHOOTRIGHTLAST, - ELITE_RELOAD, - ELITE_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_elite, CELITE) void CELITE::Spawn(void) diff --git a/dlls/wpn_shared/wpn_elite.h b/dlls/wpn_shared/wpn_elite.h index f9b20ba7e..0ac2c9a22 100644 --- a/dlls/wpn_shared/wpn_elite.h +++ b/dlls/wpn_shared/wpn_elite.h @@ -1,8 +1,4 @@ -#ifndef WPN_ELITE_H -#define WPN_ELITE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,26 @@ namespace sv { class CELITE : public CBasePlayerWeapon { + enum elite_e + { + ELITE_IDLE, + ELITE_IDLE_LEFTEMPTY, + ELITE_SHOOTLEFT1, + ELITE_SHOOTLEFT2, + ELITE_SHOOTLEFT3, + ELITE_SHOOTLEFT4, + ELITE_SHOOTLEFT5, + ELITE_SHOOTLEFTLAST, + ELITE_SHOOTRIGHT1, + ELITE_SHOOTRIGHT2, + ELITE_SHOOTRIGHT3, + ELITE_SHOOTRIGHT4, + ELITE_SHOOTRIGHT5, + ELITE_SHOOTRIGHTLAST, + ELITE_RELOAD, + ELITE_DRAW + }; + public: void Spawn() override; void Precache() override; @@ -52,5 +68,3 @@ class CELITE : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_famas.cpp b/dlls/wpn_shared/wpn_famas.cpp index 4aa6f4e1b..5a166e72a 100644 --- a/dlls/wpn_shared/wpn_famas.cpp +++ b/dlls/wpn_shared/wpn_famas.cpp @@ -26,16 +26,6 @@ namespace cl { namespace sv { #endif -enum famas_e -{ - FAMAS_IDLE1, - FAMAS_RELOAD, - FAMAS_DRAW, - FAMAS_SHOOT1, - FAMAS_SHOOT2, - FAMAS_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_famas, CFamas) void CFamas::Spawn(void) diff --git a/dlls/wpn_shared/wpn_famas.h b/dlls/wpn_shared/wpn_famas.h index ba366b68c..e8f563c0c 100644 --- a/dlls/wpn_shared/wpn_famas.h +++ b/dlls/wpn_shared/wpn_famas.h @@ -1,8 +1,4 @@ -#ifndef WPN_FAMAS_H -#define WPN_FAMAS_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,15 @@ namespace sv { class CFamas : public CBasePlayerWeapon { + enum famas_e + { + FAMAS_IDLE1, + FAMAS_RELOAD, + FAMAS_DRAW, + FAMAS_SHOOT1, + FAMAS_SHOOT2, + FAMAS_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -52,5 +57,3 @@ class CFamas : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_fiveseven.cpp b/dlls/wpn_shared/wpn_fiveseven.cpp index 2e99f5ef7..9a62b18a7 100644 --- a/dlls/wpn_shared/wpn_fiveseven.cpp +++ b/dlls/wpn_shared/wpn_fiveseven.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum fiveseven_e -{ - FIVESEVEN_IDLE, - FIVESEVEN_SHOOT1, - FIVESEVEN_SHOOT2, - FIVESEVEN_SHOOT_EMPTY, - FIVESEVEN_RELOAD, - FIVESEVEN_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_fiveseven, CFiveSeven) void CFiveSeven::Spawn(void) diff --git a/dlls/wpn_shared/wpn_fiveseven.h b/dlls/wpn_shared/wpn_fiveseven.h index b9e46154c..fbff56910 100644 --- a/dlls/wpn_shared/wpn_fiveseven.h +++ b/dlls/wpn_shared/wpn_fiveseven.h @@ -1,8 +1,4 @@ -#ifndef WPN_FIVESEVEN_H -#define WPN_FIVESEVEN_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CFiveSeven : public CBasePlayerWeapon { + enum fiveseven_e + { + FIVESEVEN_IDLE, + FIVESEVEN_SHOOT1, + FIVESEVEN_SHOOT2, + FIVESEVEN_SHOOT_EMPTY, + FIVESEVEN_RELOAD, + FIVESEVEN_DRAW + }; public: void Spawn() override; void Precache() override; @@ -57,5 +62,3 @@ class CFiveSeven : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_flashbang.cpp b/dlls/wpn_shared/wpn_flashbang.cpp index 490e7329c..281b234ec 100644 --- a/dlls/wpn_shared/wpn_flashbang.cpp +++ b/dlls/wpn_shared/wpn_flashbang.cpp @@ -26,13 +26,6 @@ namespace cl { namespace sv { #endif -enum flashbang_e -{ - FLASHBANG_IDLE, - FLASHBANG_PULLPIN, - FLASHBANG_THROW, - FLASHBANG_DRAW -}; LINK_ENTITY_TO_CLASS(weapon_flashbang, CFlashbang) diff --git a/dlls/wpn_shared/wpn_flashbang.h b/dlls/wpn_shared/wpn_flashbang.h index a974ec014..0969dfec2 100644 --- a/dlls/wpn_shared/wpn_flashbang.h +++ b/dlls/wpn_shared/wpn_flashbang.h @@ -1,8 +1,4 @@ -#ifndef WPN_FLASHBANG_H -#define WPN_FLASHBANG_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,6 +12,13 @@ namespace sv { class CFlashbang : public CBasePlayerWeapon { + enum flashbang_e + { + FLASHBANG_IDLE, + FLASHBANG_PULLPIN, + FLASHBANG_THROW, + FLASHBANG_DRAW + }; public: virtual void Spawn(); virtual void Precache(); @@ -49,5 +52,3 @@ class CFlashbang : public CBasePlayerWeapon }; } - -#endif diff --git a/dlls/wpn_shared/wpn_g3sg1.cpp b/dlls/wpn_shared/wpn_g3sg1.cpp index f35923608..106621cb7 100644 --- a/dlls/wpn_shared/wpn_g3sg1.cpp +++ b/dlls/wpn_shared/wpn_g3sg1.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum g3sg1_e -{ - G3SG1_IDLE, - G3SG1_SHOOT, - G3SG1_SHOOT2, - G3SG1_RELOAD, - G3SG1_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_g3sg1, CG3SG1) void CG3SG1::Spawn(void) diff --git a/dlls/wpn_shared/wpn_g3sg1.h b/dlls/wpn_shared/wpn_g3sg1.h index 8335d0d01..324c5edab 100644 --- a/dlls/wpn_shared/wpn_g3sg1.h +++ b/dlls/wpn_shared/wpn_g3sg1.h @@ -1,8 +1,4 @@ -#ifndef WPN_G3SG1_H -#define WPN_G3SG1_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,14 @@ namespace sv { class CG3SG1 : public CBasePlayerWeapon { + enum g3sg1_e + { + G3SG1_IDLE, + G3SG1_SHOOT, + G3SG1_SHOOT2, + G3SG1_RELOAD, + G3SG1_DRAW + }; public: void Spawn() override; void Precache() override; @@ -53,5 +57,3 @@ class CG3SG1 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_galil.cpp b/dlls/wpn_shared/wpn_galil.cpp index 9bb77bbdd..facdd6459 100644 --- a/dlls/wpn_shared/wpn_galil.cpp +++ b/dlls/wpn_shared/wpn_galil.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum galil_e -{ - GALIL_IDLE1, - GALIL_RELOAD, - GALIL_DRAW, - GALIL_SHOOT1, - GALIL_SHOOT2, - GALIL_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_galil, CGalil) void CGalil::Spawn(void) diff --git a/dlls/wpn_shared/wpn_galil.h b/dlls/wpn_shared/wpn_galil.h index 2fe569323..c26b97f1e 100644 --- a/dlls/wpn_shared/wpn_galil.h +++ b/dlls/wpn_shared/wpn_galil.h @@ -1,8 +1,4 @@ -#ifndef WPN_GALIL_H -#define WPN_GALIL_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,15 @@ namespace sv { #define GALIL_INSPECT_TIME 3.67s class CGalil : public CBasePlayerWeapon { + enum galil_e + { + GALIL_IDLE1, + GALIL_RELOAD, + GALIL_DRAW, + GALIL_SHOOT1, + GALIL_SHOOT2, + GALIL_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -53,5 +58,3 @@ class CGalil : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_gatling.cpp b/dlls/wpn_shared/wpn_gatling.cpp index 5639d5246..2da91b79a 100644 --- a/dlls/wpn_shared/wpn_gatling.cpp +++ b/dlls/wpn_shared/wpn_gatling.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum gatling_e -{ - GATLING_IDLE, - GATLING_FIRE1, - GATLING_FIRE2, - GATLING_RELOAD, - GATLING_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_gatling, CGatling) void CGatling::Spawn(void) diff --git a/dlls/wpn_shared/wpn_gatling.h b/dlls/wpn_shared/wpn_gatling.h index b66a46d3d..8a193c81c 100644 --- a/dlls/wpn_shared/wpn_gatling.h +++ b/dlls/wpn_shared/wpn_gatling.h @@ -1,8 +1,4 @@ -#ifndef WPN_XM1014_H -#define WPN_XM1014_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,14 @@ namespace sv { class CGatling : public CBasePlayerWeapon { + enum gatling_e + { + GATLING_IDLE, + GATLING_FIRE1, + GATLING_FIRE2, + GATLING_RELOAD, + GATLING_DRAW + }; public: void Spawn() override; void Precache() override; @@ -50,5 +54,3 @@ class CGatling : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_gatlingex.cpp b/dlls/wpn_shared/wpn_gatlingex.cpp index a9fd9bb1d..e6801e348 100644 --- a/dlls/wpn_shared/wpn_gatlingex.cpp +++ b/dlls/wpn_shared/wpn_gatlingex.cpp @@ -259,16 +259,6 @@ namespace sv { LINK_ENTITY_TO_CLASS(gatlingex_projectile, CGatlingexProjectile) #endif -enum gatlingex_e -{ - GATLINGEX_IDLE, - GATLINGEX_FIRE1, - GATLINGEX_FIRE2, - GATLINGEX_RELOAD, - GATLINGEX_DRAW, - GATLINGEX_FIREBALL -}; - LINK_ENTITY_TO_CLASS(weapon_gatlingex, CGatlingex) void CGatlingex::Spawn(void) diff --git a/dlls/wpn_shared/wpn_gatlingex.h b/dlls/wpn_shared/wpn_gatlingex.h index 4f5079b9a..6d06beea0 100644 --- a/dlls/wpn_shared/wpn_gatlingex.h +++ b/dlls/wpn_shared/wpn_gatlingex.h @@ -1,8 +1,4 @@ -#ifndef WPN_XM1014_H -#define WPN_XM1014_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,15 @@ namespace sv { class CGatlingex : public CBasePlayerWeapon { + enum gatlingex_e + { + GATLINGEX_IDLE, + GATLINGEX_FIRE1, + GATLINGEX_FIRE2, + GATLINGEX_RELOAD, + GATLINGEX_DRAW, + GATLINGEX_FIREBALL + }; public: void Spawn() override; void Precache() override; @@ -56,5 +61,3 @@ class CGatlingex : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_glock18.cpp b/dlls/wpn_shared/wpn_glock18.cpp index 6c4ca24b1..3d6c9747e 100644 --- a/dlls/wpn_shared/wpn_glock18.cpp +++ b/dlls/wpn_shared/wpn_glock18.cpp @@ -30,36 +30,6 @@ namespace sv { extern bool g_bGlockBurstMode; #endif -enum glock18_e -{ - GLOCK18_IDLE1, - GLOCK18_IDLE2, - GLOCK18_IDLE3, - GLOCK18_SHOOT, - GLOCK18_SHOOT2, - GLOCK18_SHOOT3, - GLOCK18_SHOOT_EMPTY, - GLOCK18_RELOAD, - GLOCK18_DRAW, - GLOCK18_HOLSTER, - GLOCK18_ADD_SILENCER, - GLOCK18_DRAW2, - GLOCK18_RELOAD2 -}; - -enum glock18_shield_e -{ - GLOCK18_SHIELD_IDLE1, - GLOCK18_SHIELD_SHOOT, - GLOCK18_SHIELD_SHOOT2, - GLOCK18_SHIELD_SHOOT_EMPTY, - GLOCK18_SHIELD_RELOAD, - GLOCK18_SHIELD_DRAW, - GLOCK18_SHIELD_IDLE, - GLOCK18_SHIELD_UP, - GLOCK18_SHIELD_DOWN -}; - LINK_ENTITY_TO_CLASS(weapon_glock18, CGLOCK18) void CGLOCK18::Spawn(void) diff --git a/dlls/wpn_shared/wpn_glock18.h b/dlls/wpn_shared/wpn_glock18.h index 2fd2ec118..a954e719c 100644 --- a/dlls/wpn_shared/wpn_glock18.h +++ b/dlls/wpn_shared/wpn_glock18.h @@ -1,8 +1,4 @@ -#ifndef WPN_GLOCK18_H -#define WPN_GLOCK18_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,36 @@ namespace sv { class CGLOCK18 : public CBasePlayerWeapon { + enum glock18_e + { + GLOCK18_IDLE1, + GLOCK18_IDLE2, + GLOCK18_IDLE3, + GLOCK18_SHOOT, + GLOCK18_SHOOT2, + GLOCK18_SHOOT3, + GLOCK18_SHOOT_EMPTY, + GLOCK18_RELOAD, + GLOCK18_DRAW, + GLOCK18_HOLSTER, + GLOCK18_ADD_SILENCER, + GLOCK18_DRAW2, + GLOCK18_RELOAD2 + }; + + enum glock18_shield_e + { + GLOCK18_SHIELD_IDLE1, + GLOCK18_SHIELD_SHOOT, + GLOCK18_SHIELD_SHOOT2, + GLOCK18_SHIELD_SHOOT_EMPTY, + GLOCK18_SHIELD_RELOAD, + GLOCK18_SHIELD_DRAW, + GLOCK18_SHIELD_IDLE, + GLOCK18_SHIELD_UP, + GLOCK18_SHIELD_DOWN + }; + public: void Spawn() override; void Precache() override; @@ -52,5 +78,3 @@ class CGLOCK18 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_hegrenade.cpp b/dlls/wpn_shared/wpn_hegrenade.cpp index 4c9acf746..9e799b311 100644 --- a/dlls/wpn_shared/wpn_hegrenade.cpp +++ b/dlls/wpn_shared/wpn_hegrenade.cpp @@ -26,14 +26,6 @@ namespace cl { namespace sv { #endif -enum hegrenade_e -{ - HEGRENADE_IDLE, - HEGRENADE_PULLPIN, - HEGRENADE_THROW, - HEGRENADE_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_hegrenade, CHEGrenade) void CHEGrenade::Spawn(void) diff --git a/dlls/wpn_shared/wpn_hegrenade.h b/dlls/wpn_shared/wpn_hegrenade.h index 500701c24..250fef38d 100644 --- a/dlls/wpn_shared/wpn_hegrenade.h +++ b/dlls/wpn_shared/wpn_hegrenade.h @@ -1,8 +1,4 @@ -#ifndef WPN_HEGRENADE_H -#define WPN_HEGRENADE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,6 +12,13 @@ namespace sv { class CHEGrenade : public CBasePlayerWeapon { + enum hegrenade_e + { + HEGRENADE_IDLE, + HEGRENADE_PULLPIN, + HEGRENADE_THROW, + HEGRENADE_DRAW + }; public: virtual void Spawn(); virtual void Precache(); @@ -49,5 +52,3 @@ class CHEGrenade : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_infinity.h b/dlls/wpn_shared/wpn_infinity.h index 653f19f2d..6b836e467 100644 --- a/dlls/wpn_shared/wpn_infinity.h +++ b/dlls/wpn_shared/wpn_infinity.h @@ -1,8 +1,4 @@ -#ifndef WPN_DEAGLED_H -#define WPN_DEAGLED_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -80,5 +76,3 @@ class CInfinity : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_infinityex1.h b/dlls/wpn_shared/wpn_infinityex1.h index 4cb44e341..ee9567115 100644 --- a/dlls/wpn_shared/wpn_infinityex1.h +++ b/dlls/wpn_shared/wpn_infinityex1.h @@ -13,11 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#ifndef WPN_DEAGLED_H -#define WPN_DEAGLED_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -95,5 +91,3 @@ class CInfinityEX1 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_infinityex2.h b/dlls/wpn_shared/wpn_infinityex2.h index bbbab25d1..fee83389e 100644 --- a/dlls/wpn_shared/wpn_infinityex2.h +++ b/dlls/wpn_shared/wpn_infinityex2.h @@ -13,11 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#ifndef WPN_DEAGLED_H -#define WPN_DEAGLED_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -95,5 +91,3 @@ class CInfinityEX2 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_janus7xmas.cpp b/dlls/wpn_shared/wpn_janus7xmas.cpp index cea5912ab..f6cb99427 100644 --- a/dlls/wpn_shared/wpn_janus7xmas.cpp +++ b/dlls/wpn_shared/wpn_janus7xmas.cpp @@ -32,25 +32,6 @@ namespace sv { class CBeam; - enum Janus7xmas_e - { - ANIM_IDLE = 0, - ANIM_RELOAD, - ANIM_DRAW, - ANIM_SHOOT1, - ANIM_SHOOT2, - ANIM_SHOOT_SIGNAL, - ANIM_CHANGEB, - ANIM_IDLEB, - ANIM_DRAWB, - ANIM_SHOOTB1, - ANIM_SHOOTB2, - ANIM_CHANGEA, - ANIM_IDLE_SIGNAL, - ANIM_RELOAD_SIGNAL, - ANIM_DRAW_SIGNAL, - }; - LINK_ENTITY_TO_CLASS(weapon_janus7xmas, CJanus7xmas) static const int MG3_AMMO_GIVE = 200; diff --git a/dlls/wpn_shared/wpn_janus7xmas.h b/dlls/wpn_shared/wpn_janus7xmas.h index 6e74c4ff0..a7ccdf721 100644 --- a/dlls/wpn_shared/wpn_janus7xmas.h +++ b/dlls/wpn_shared/wpn_janus7xmas.h @@ -1,8 +1,4 @@ -#ifndef WPN_MG3_H -#define WPN_MG3_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -27,6 +23,24 @@ namespace sv { class CJanus7xmas : public CBasePlayerWeapon { + enum Janus7xmas_e + { + ANIM_IDLE = 0, + ANIM_RELOAD, + ANIM_DRAW, + ANIM_SHOOT1, + ANIM_SHOOT2, + ANIM_SHOOT_SIGNAL, + ANIM_CHANGEB, + ANIM_IDLEB, + ANIM_DRAWB, + ANIM_SHOOTB1, + ANIM_SHOOTB2, + ANIM_CHANGEA, + ANIM_IDLE_SIGNAL, + ANIM_RELOAD_SIGNAL, + ANIM_DRAW_SIGNAL, + }; public: void Spawn() override; void Precache() override; @@ -68,5 +82,3 @@ class CJanus7xmas : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_k1a.cpp b/dlls/wpn_shared/wpn_k1a.cpp index 85ced37c2..cec916b43 100644 --- a/dlls/wpn_shared/wpn_k1a.cpp +++ b/dlls/wpn_shared/wpn_k1a.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum k1a_e -{ - K1A_IDLE1, - K1A_RELOAD, - K1A_DRAW, - K1A_SHOOT1, - K1A_SHOOT2, - K1A_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_k1a, CK1a) const int K1A_MAXCLIP = 30; diff --git a/dlls/wpn_shared/wpn_k1a.h b/dlls/wpn_shared/wpn_k1a.h index f63dc50fe..73beaf52f 100644 --- a/dlls/wpn_shared/wpn_k1a.h +++ b/dlls/wpn_shared/wpn_k1a.h @@ -1,8 +1,4 @@ -#ifndef WPN_K1A_H -#define WPN_K1A_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,15 @@ namespace sv { class CK1a : public CBasePlayerWeapon { + enum k1a_e + { + K1A_IDLE1, + K1A_RELOAD, + K1A_DRAW, + K1A_SHOOT1, + K1A_SHOOT2, + K1A_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -51,5 +56,3 @@ class CK1a : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_knife.cpp b/dlls/wpn_shared/wpn_knife.cpp index c42e21967..11339ad66 100644 --- a/dlls/wpn_shared/wpn_knife.cpp +++ b/dlls/wpn_shared/wpn_knife.cpp @@ -30,34 +30,8 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - LINK_ENTITY_TO_CLASS(weapon_knife, CKnife) -enum knife_e -{ - KNIFE_IDLE, - KNIFE_ATTACK1HIT, - KNIFE_ATTACK2HIT, - KNIFE_DRAW, - KNIFE_STABHIT, - KNIFE_STABMISS, - KNIFE_MIDATTACK1HIT, - KNIFE_MIDATTACK2HIT -}; - -enum knife_shield_e -{ - KNIFE_SHIELD_IDLE, - KNIFE_SHIELD_SLASH, - KNIFE_SHIELD_ATTACKHIT, - KNIFE_SHIELD_DRAW, - KNIFE_SHIELD_UPIDLE, - KNIFE_SHIELD_UP, - KNIFE_SHIELD_DOWN -}; - void CKnife::Spawn(void) { Precache(); diff --git a/dlls/wpn_shared/wpn_knife.h b/dlls/wpn_shared/wpn_knife.h index 14e3636e8..e370a5331 100644 --- a/dlls/wpn_shared/wpn_knife.h +++ b/dlls/wpn_shared/wpn_knife.h @@ -1,8 +1,4 @@ -#ifndef WPN_KNIFE_H -#define WPN_KNIFE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -11,14 +7,35 @@ namespace sv { #endif //knife -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 #define KNIFE_MAX_SPEED 250 #define KNIFE_MAX_SPEED_SHIELD 180 #define KNIFE_INSPECT_TIME 4.92s class CKnife : public CBasePlayerWeapon { + enum knife_e + { + KNIFE_IDLE, + KNIFE_ATTACK1HIT, + KNIFE_ATTACK2HIT, + KNIFE_DRAW, + KNIFE_STABHIT, + KNIFE_STABMISS, + KNIFE_MIDATTACK1HIT, + KNIFE_MIDATTACK2HIT + }; + + enum knife_shield_e + { + KNIFE_SHIELD_IDLE, + KNIFE_SHIELD_SLASH, + KNIFE_SHIELD_ATTACKHIT, + KNIFE_SHIELD_DRAW, + KNIFE_SHIELD_UPIDLE, + KNIFE_SHIELD_UP, + KNIFE_SHIELD_DOWN + }; + public: void Spawn() override; void Precache() override; @@ -65,5 +82,3 @@ class CKnife : public CBasePlayerWeapon void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, const float *mins, const float *maxs, edict_t *pEntity); } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_knifedragon.cpp b/dlls/wpn_shared/wpn_knifedragon.cpp index 09a85ec22..4fb9b45ba 100644 --- a/dlls/wpn_shared/wpn_knifedragon.cpp +++ b/dlls/wpn_shared/wpn_knifedragon.cpp @@ -30,34 +30,8 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - LINK_ENTITY_TO_CLASS(knife_knifedragon, CKnifeDragon) -enum knife_e -{ - KNIFE_IDLE, - KNIFE_ATTACK1HIT, - KNIFE_ATTACK2HIT, - KNIFE_DRAW, - KNIFE_STABHIT, - KNIFE_STABMISS, - KNIFE_MIDATTACK1HIT, - KNIFE_MIDATTACK2HIT -}; - -enum knife_shield_e -{ - KNIFE_SHIELD_IDLE, - KNIFE_SHIELD_SLASH, - KNIFE_SHIELD_ATTACKHIT, - KNIFE_SHIELD_DRAW, - KNIFE_SHIELD_UPIDLE, - KNIFE_SHIELD_UP, - KNIFE_SHIELD_DOWN -}; - void CKnifeDragon::Spawn(void) { Precache(); diff --git a/dlls/wpn_shared/wpn_knifedragon.h b/dlls/wpn_shared/wpn_knifedragon.h index b47004c80..f2a7d5219 100644 --- a/dlls/wpn_shared/wpn_knifedragon.h +++ b/dlls/wpn_shared/wpn_knifedragon.h @@ -1,8 +1,4 @@ -#ifndef WPN_KNIFE_H -#define WPN_KNIFE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -11,14 +7,35 @@ namespace sv { #endif //knife -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 #define KNIFE_MAX_SPEED 250 #define KNIFE_MAX_SPEED_SHIELD 180 #define KNIFE_INSPECT_TIME 4.48s class CKnifeDragon : public CBasePlayerWeapon { + enum knife_e + { + KNIFE_IDLE, + KNIFE_ATTACK1HIT, + KNIFE_ATTACK2HIT, + KNIFE_DRAW, + KNIFE_STABHIT, + KNIFE_STABMISS, + KNIFE_MIDATTACK1HIT, + KNIFE_MIDATTACK2HIT + }; + + enum knife_shield_e + { + KNIFE_SHIELD_IDLE, + KNIFE_SHIELD_SLASH, + KNIFE_SHIELD_ATTACKHIT, + KNIFE_SHIELD_DRAW, + KNIFE_SHIELD_UPIDLE, + KNIFE_SHIELD_UP, + KNIFE_SHIELD_DOWN + }; + public: void Spawn() override; void Precache() override; @@ -60,5 +77,3 @@ class CKnifeDragon : public CBasePlayerWeapon void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, const float *mins, const float *maxs, edict_t *pEntity); } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_kriss.cpp b/dlls/wpn_shared/wpn_kriss.cpp index a3687c611..4e8289b44 100644 --- a/dlls/wpn_shared/wpn_kriss.cpp +++ b/dlls/wpn_shared/wpn_kriss.cpp @@ -26,24 +26,6 @@ namespace cl { namespace sv { #endif -enum kriss_e -{ - KRISS_IDLE, - KRISS_SHOOT1, - KRISS_SHOOT2, - KRISS_SHOOT3, - KRISS_RELOAD, - KRISS_DRAW, - KRISS_ATTACH_SILENCER, - KRISS_UNSIL_IDLE, - KRISS_UNSIL_SHOOT1, - KRISS_UNSIL_SHOOT2, - KRISS_UNSIL_SHOOT3, - KRISS_UNSIL_RELOAD, - KRISS_UNSIL_DRAW, - KRISS_DETACH_SILENCER -}; - LINK_ENTITY_TO_CLASS(weapon_kriss, CKRISS) const int KRISS_MAXCLIP = 30; diff --git a/dlls/wpn_shared/wpn_kriss.h b/dlls/wpn_shared/wpn_kriss.h index 35d4064c5..60fcd1251 100644 --- a/dlls/wpn_shared/wpn_kriss.h +++ b/dlls/wpn_shared/wpn_kriss.h @@ -1,8 +1,4 @@ -#ifndef WPN_KRISS_H -#define WPN_KRISS_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -22,6 +18,23 @@ namespace sv { class CKRISS : public CBasePlayerWeapon { + enum kriss_e + { + KRISS_IDLE, + KRISS_SHOOT1, + KRISS_SHOOT2, + KRISS_SHOOT3, + KRISS_RELOAD, + KRISS_DRAW, + KRISS_ATTACH_SILENCER, + KRISS_UNSIL_IDLE, + KRISS_UNSIL_SHOOT1, + KRISS_UNSIL_SHOOT2, + KRISS_UNSIL_SHOOT3, + KRISS_UNSIL_RELOAD, + KRISS_UNSIL_DRAW, + KRISS_DETACH_SILENCER + }; public: void Spawn() override; void Precache() override; @@ -55,5 +68,3 @@ class CKRISS : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m134.cpp b/dlls/wpn_shared/wpn_m134.cpp index 04f0ce162..dfc554d25 100644 --- a/dlls/wpn_shared/wpn_m134.cpp +++ b/dlls/wpn_shared/wpn_m134.cpp @@ -30,19 +30,6 @@ namespace cl { namespace sv { #endif -enum m134_e -{ - M134_IDLE1, - M134_DRAW, - M134_RELOAD, - M134_FIRE_READY, - M134_SHOOT, - M134_FIRE_AFTER, - M134_FIRE_CHANGE, - M134_IDLE_CHANGE, - M134_FIRE_LOOP, -}; - LINK_ENTITY_TO_CLASS(weapon_m134, CM134) void CM134::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m134.h b/dlls/wpn_shared/wpn_m134.h index 0c3f08dd7..422a63b7b 100644 --- a/dlls/wpn_shared/wpn_m134.h +++ b/dlls/wpn_shared/wpn_m134.h @@ -1,8 +1,4 @@ -#ifndef WPN_M249_H -#define WPN_M249_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,18 @@ namespace sv { class CM134 : public CBasePlayerWeapon { + enum m134_e + { + M134_IDLE1, + M134_DRAW, + M134_RELOAD, + M134_FIRE_READY, + M134_SHOOT, + M134_FIRE_AFTER, + M134_FIRE_CHANGE, + M134_IDLE_CHANGE, + M134_FIRE_LOOP, + }; public: void Spawn() override; void Precache() override; @@ -56,5 +64,3 @@ class CM134 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m134ex.cpp b/dlls/wpn_shared/wpn_m134ex.cpp index c658c0590..b949469d1 100644 --- a/dlls/wpn_shared/wpn_m134ex.cpp +++ b/dlls/wpn_shared/wpn_m134ex.cpp @@ -30,19 +30,6 @@ namespace cl { namespace sv { #endif -enum m134ex_e -{ - M134_IDLE1, - M134_DRAW, - M134_RELOAD, - M134_FIRE_READY, - M134_SHOOT, - M134_FIRE_AFTER, - M134_FIRE_CHANGE, - M134_IDLE_CHANGE, - M134_FIRE_LOOP, -}; - LINK_ENTITY_TO_CLASS(weapon_m134ex, CM134ex) void CM134ex::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m134ex.h b/dlls/wpn_shared/wpn_m134ex.h index 28d4481d0..c8f9b1f4f 100644 --- a/dlls/wpn_shared/wpn_m134ex.h +++ b/dlls/wpn_shared/wpn_m134ex.h @@ -1,8 +1,4 @@ -#ifndef WPN_M249_H -#define WPN_M249_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,19 @@ namespace sv { class CM134ex : public CBasePlayerWeapon { + enum m134ex_e + { + M134_IDLE1, + M134_DRAW, + M134_RELOAD, + M134_FIRE_READY, + M134_SHOOT, + M134_FIRE_AFTER, + M134_FIRE_CHANGE, + M134_IDLE_CHANGE, + M134_FIRE_LOOP, + }; + public: void Spawn() override; void Precache() override; @@ -56,5 +65,3 @@ class CM134ex : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m134xmas.cpp b/dlls/wpn_shared/wpn_m134xmas.cpp index 61ab5a469..0bc10149c 100644 --- a/dlls/wpn_shared/wpn_m134xmas.cpp +++ b/dlls/wpn_shared/wpn_m134xmas.cpp @@ -30,19 +30,6 @@ namespace cl { namespace sv { #endif -enum m134xmas_e -{ - M134_IDLE1, - M134_DRAW, - M134_RELOAD, - M134_FIRE_READY, - M134_SHOOT, - M134_FIRE_AFTER, - M134_FIRE_CHANGE, - M134_IDLE_CHANGE, - M134_FIRE_LOOP, -}; - LINK_ENTITY_TO_CLASS(weapon_m134xmas, CM134xmas) void CM134xmas::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m134xmas.h b/dlls/wpn_shared/wpn_m134xmas.h index abbd83c61..2fca9bebd 100644 --- a/dlls/wpn_shared/wpn_m134xmas.h +++ b/dlls/wpn_shared/wpn_m134xmas.h @@ -1,8 +1,4 @@ -#ifndef WPN_M249_H -#define WPN_M249_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,18 @@ namespace sv { class CM134xmas : public CBasePlayerWeapon { + enum m134xmas_e + { + M134_IDLE1, + M134_DRAW, + M134_RELOAD, + M134_FIRE_READY, + M134_SHOOT, + M134_FIRE_AFTER, + M134_FIRE_CHANGE, + M134_IDLE_CHANGE, + M134_FIRE_LOOP, + }; public: void Spawn() override; void Precache() override; @@ -56,5 +64,3 @@ class CM134xmas : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m14ebr.cpp b/dlls/wpn_shared/wpn_m14ebr.cpp index ffdb91441..e119191f7 100644 --- a/dlls/wpn_shared/wpn_m14ebr.cpp +++ b/dlls/wpn_shared/wpn_m14ebr.cpp @@ -26,14 +26,6 @@ namespace cl { namespace sv { #endif -enum m14ebr_e -{ - M14EBR_IDLE1, - M14EBR_RELOAD, - M14EBR_DRAW, - M14EBR_SHOOT1 -}; - LINK_ENTITY_TO_CLASS(weapon_m14ebr, CM14EBR) const int M14EBR_MAXCLIP = 20; diff --git a/dlls/wpn_shared/wpn_m14ebr.h b/dlls/wpn_shared/wpn_m14ebr.h index 1acb2b021..653bbb8d0 100644 --- a/dlls/wpn_shared/wpn_m14ebr.h +++ b/dlls/wpn_shared/wpn_m14ebr.h @@ -1,8 +1,4 @@ -#ifndef WPN_M14EBR_H -#define WPN_M14EBR_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,13 @@ namespace sv { class CM14EBR : public CBasePlayerWeapon { + enum m14ebr_e + { + M14EBR_IDLE1, + M14EBR_RELOAD, + M14EBR_DRAW, + M14EBR_SHOOT1 + }; public: void Spawn() override; void Precache() override; @@ -51,5 +54,3 @@ class CM14EBR : public CBasePlayerWeapon }; } - -#endif diff --git a/dlls/wpn_shared/wpn_m1887.cpp b/dlls/wpn_shared/wpn_m1887.cpp index 050328353..4ff722d41 100644 --- a/dlls/wpn_shared/wpn_m1887.cpp +++ b/dlls/wpn_shared/wpn_m1887.cpp @@ -26,20 +26,6 @@ namespace cl { namespace sv { #endif -enum m1887_e -{ - M1887_IDLE, - M1887_FIRE1, - M1887_FIRE2, - M1887_FIRE3, - M1887_FIRE4, - M1887_FIRE5, - M1887_RELOAD, - M1887_PUMP, - M1887_START_RELOAD, - M1887_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_m1887, CM1887) const int M1887_MAX_CLIP = 8; diff --git a/dlls/wpn_shared/wpn_m1887.h b/dlls/wpn_shared/wpn_m1887.h index 29a1add40..0ff4d25c4 100644 --- a/dlls/wpn_shared/wpn_m1887.h +++ b/dlls/wpn_shared/wpn_m1887.h @@ -1,8 +1,4 @@ -#ifndef WPN_M1887_H -#define WPN_M1887_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,6 +12,19 @@ namespace sv { class CM1887 : public CBasePlayerWeapon { + enum m1887_e + { + M1887_IDLE, + M1887_FIRE1, + M1887_FIRE2, + M1887_FIRE3, + M1887_FIRE4, + M1887_FIRE5, + M1887_RELOAD, + M1887_PUMP, + M1887_START_RELOAD, + M1887_DRAW + }; public: void Spawn() override; void Precache() override; @@ -46,5 +55,3 @@ class CM1887 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m2.cpp b/dlls/wpn_shared/wpn_m2.cpp index 6c866749c..baf2ab679 100644 --- a/dlls/wpn_shared/wpn_m2.cpp +++ b/dlls/wpn_shared/wpn_m2.cpp @@ -30,24 +30,6 @@ namespace cl { namespace sv { #endif - enum M2_e - { - M2_IDLEA, - M2_IDLEB, - M2_DRAWA, - M2_DRAW_EMPTY, - M2_CHANGEA, - M2_CHANGEA_EMPTY, - M2_CHANGEB, - M2_CHANGEB_EMPTY, - M2_RELOADA, - M2_RELOADB, - M2_SHOOTA, - M2_SHOOTB, - M2_IDLEA_EMPTY, - M2_IDLEB_EMPTY, - }; - LINK_ENTITY_TO_CLASS(weapon_m2, CM2) void CM2::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m2.h b/dlls/wpn_shared/wpn_m2.h index 060a49c5d..96bf95e5b 100644 --- a/dlls/wpn_shared/wpn_m2.h +++ b/dlls/wpn_shared/wpn_m2.h @@ -1,8 +1,4 @@ -#ifndef WPN_M4A1_H -#define WPN_M4A1_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,6 +12,23 @@ namespace sv { class CM2 : public CBasePlayerWeapon { + enum M2_e + { + M2_IDLEA, + M2_IDLEB, + M2_DRAWA, + M2_DRAW_EMPTY, + M2_CHANGEA, + M2_CHANGEA_EMPTY, + M2_CHANGEB, + M2_CHANGEB_EMPTY, + M2_RELOADA, + M2_RELOADB, + M2_SHOOTA, + M2_SHOOTB, + M2_IDLEA_EMPTY, + M2_IDLEB_EMPTY, + }; public: void Spawn() override; void Precache() override; @@ -54,5 +67,3 @@ class CM2 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m249.cpp b/dlls/wpn_shared/wpn_m249.cpp index c7eab419e..d6b3e92c8 100644 --- a/dlls/wpn_shared/wpn_m249.cpp +++ b/dlls/wpn_shared/wpn_m249.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum m249_e -{ - M249_IDLE1, - M249_SHOOT1, - M249_SHOOT2, - M249_RELOAD, - M249_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_m249, CM249) void CM249::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m249.h b/dlls/wpn_shared/wpn_m249.h index e5b9a869c..6102c931b 100644 --- a/dlls/wpn_shared/wpn_m249.h +++ b/dlls/wpn_shared/wpn_m249.h @@ -1,8 +1,4 @@ -#ifndef WPN_M249_H -#define WPN_M249_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,14 @@ namespace sv { class CM249 : public CBasePlayerWeapon { + enum m249_e + { + M249_IDLE1, + M249_SHOOT1, + M249_SHOOT2, + M249_RELOAD, + M249_DRAW + }; public: void Spawn() override; void Precache() override; @@ -52,5 +56,3 @@ class CM249 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m3.cpp b/dlls/wpn_shared/wpn_m3.cpp index 60184b94f..e46cab4ca 100644 --- a/dlls/wpn_shared/wpn_m3.cpp +++ b/dlls/wpn_shared/wpn_m3.cpp @@ -26,18 +26,6 @@ namespace cl { namespace sv { #endif -enum m3_e -{ - M3_IDLE, - M3_FIRE1, - M3_FIRE2, - M3_RELOAD, - M3_PUMP, - M3_START_RELOAD, - M3_DRAW, - M3_HOLSTER -}; - LINK_ENTITY_TO_CLASS(weapon_m3, CM3) void CM3::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m3.h b/dlls/wpn_shared/wpn_m3.h index 881e7bae2..7fb33dd59 100644 --- a/dlls/wpn_shared/wpn_m3.h +++ b/dlls/wpn_shared/wpn_m3.h @@ -1,8 +1,4 @@ -#ifndef WPN_M3_H -#define WPN_M3_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -17,6 +13,17 @@ namespace sv { class CM3 : public CBasePlayerWeapon { + enum m3_e + { + M3_IDLE, + M3_FIRE1, + M3_FIRE2, + M3_RELOAD, + M3_PUMP, + M3_START_RELOAD, + M3_DRAW, + M3_HOLSTER + }; public: void Spawn() override; void Precache() override; @@ -48,5 +55,3 @@ class CM3 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m4a1.cpp b/dlls/wpn_shared/wpn_m4a1.cpp index 6850c75ae..68fc8d520 100644 --- a/dlls/wpn_shared/wpn_m4a1.cpp +++ b/dlls/wpn_shared/wpn_m4a1.cpp @@ -26,24 +26,6 @@ namespace cl { namespace sv { #endif -enum m4a1_e -{ - M4A1_IDLE, - M4A1_SHOOT1, - M4A1_SHOOT2, - M4A1_SHOOT3, - M4A1_RELOAD, - M4A1_DRAW, - M4A1_ATTACH_SILENCER, - M4A1_UNSIL_IDLE, - M4A1_UNSIL_SHOOT1, - M4A1_UNSIL_SHOOT2, - M4A1_UNSIL_SHOOT3, - M4A1_UNSIL_RELOAD, - M4A1_UNSIL_DRAW, - M4A1_DETACH_SILENCER -}; - LINK_ENTITY_TO_CLASS(weapon_m4a1, CM4A1) void CM4A1::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m4a1.h b/dlls/wpn_shared/wpn_m4a1.h index 3297f0bf5..2c451554e 100644 --- a/dlls/wpn_shared/wpn_m4a1.h +++ b/dlls/wpn_shared/wpn_m4a1.h @@ -1,8 +1,4 @@ -#ifndef WPN_M4A1_H -#define WPN_M4A1_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,23 @@ namespace sv { class CM4A1 : public CBasePlayerWeapon { + enum m4a1_e + { + M4A1_IDLE, + M4A1_SHOOT1, + M4A1_SHOOT2, + M4A1_SHOOT3, + M4A1_RELOAD, + M4A1_DRAW, + M4A1_ATTACH_SILENCER, + M4A1_UNSIL_IDLE, + M4A1_UNSIL_SHOOT1, + M4A1_UNSIL_SHOOT2, + M4A1_UNSIL_SHOOT3, + M4A1_UNSIL_RELOAD, + M4A1_UNSIL_DRAW, + M4A1_DETACH_SILENCER + }; public: void Spawn() override; void Precache() override; @@ -55,5 +68,3 @@ class CM4A1 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m4a1dragon.cpp b/dlls/wpn_shared/wpn_m4a1dragon.cpp index c3f0465d4..0cdcbac46 100644 --- a/dlls/wpn_shared/wpn_m4a1dragon.cpp +++ b/dlls/wpn_shared/wpn_m4a1dragon.cpp @@ -26,26 +26,6 @@ namespace cl { namespace sv { #endif -enum m4a1_e -{ - M4A1_IDLE, - M4A1_SHOOT1, - M4A1_SHOOT2, - M4A1_SHOOT3, - M4A1_RELOAD, - M4A1_DRAW, - M4A1_ATTACH_SILENCER, - M4A1_UNSIL_IDLE, - M4A1_UNSIL_SHOOT1, - M4A1_UNSIL_SHOOT2, - M4A1_UNSIL_SHOOT3, - M4A1_UNSIL_RELOAD, - M4A1_UNSIL_DRAW, - M4A1_DETACH_SILENCER, - M4A1_RELOADD, - M4A1_UNSIL_RELOADD -}; - LINK_ENTITY_TO_CLASS(weapon_m4a1dragon, CM4A1Dragon) void CM4A1Dragon::Spawn(void) diff --git a/dlls/wpn_shared/wpn_m4a1dragon.h b/dlls/wpn_shared/wpn_m4a1dragon.h index fdf39a7dc..c97628a31 100644 --- a/dlls/wpn_shared/wpn_m4a1dragon.h +++ b/dlls/wpn_shared/wpn_m4a1dragon.h @@ -1,8 +1,4 @@ -#ifndef WPN_M4A1_H -#define WPN_M4A1_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,25 @@ namespace sv { class CM4A1Dragon : public CBasePlayerWeapon { + enum m4a1_e + { + M4A1_IDLE, + M4A1_SHOOT1, + M4A1_SHOOT2, + M4A1_SHOOT3, + M4A1_RELOAD, + M4A1_DRAW, + M4A1_ATTACH_SILENCER, + M4A1_UNSIL_IDLE, + M4A1_UNSIL_SHOOT1, + M4A1_UNSIL_SHOOT2, + M4A1_UNSIL_SHOOT3, + M4A1_UNSIL_RELOAD, + M4A1_UNSIL_DRAW, + M4A1_DETACH_SILENCER, + M4A1_RELOADD, + M4A1_UNSIL_RELOADD + }; public: void Spawn() override; void Precache() override; @@ -53,5 +68,3 @@ class CM4A1Dragon : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m95.cpp b/dlls/wpn_shared/wpn_m95.cpp index f6dba1685..3839b1da3 100644 --- a/dlls/wpn_shared/wpn_m95.cpp +++ b/dlls/wpn_shared/wpn_m95.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum m95_e -{ - M95_IDLE, - M95_SHOOT1, - M95_SHOOT2, - M95_RELOAD, - M95_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_m95, CM95) const int M95_MAXCLIP = 5; diff --git a/dlls/wpn_shared/wpn_m95.h b/dlls/wpn_shared/wpn_m95.h index b44b3bbb9..9a9ad7170 100644 --- a/dlls/wpn_shared/wpn_m95.h +++ b/dlls/wpn_shared/wpn_m95.h @@ -1,8 +1,4 @@ -#ifndef WPN_M95_H -#define WPN_M95_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,14 @@ namespace sv { class CM95 : public CBasePlayerWeapon { + enum m95_e + { + M95_IDLE, + M95_SHOOT1, + M95_SHOOT2, + M95_RELOAD, + M95_DRAW + }; public: void Spawn() override; void Precache() override; @@ -54,5 +58,3 @@ class CM95 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_m95xmas.cpp b/dlls/wpn_shared/wpn_m95xmas.cpp index 2c8fb8a0c..075faefe1 100644 --- a/dlls/wpn_shared/wpn_m95xmas.cpp +++ b/dlls/wpn_shared/wpn_m95xmas.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum m95xmas_e -{ - M95_IDLE, - M95_SHOOT1, - M95_SHOOT2, - M95_RELOAD, - M95_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_m95xmas, CM95xmas) const int M95_MAXCLIP = 5; diff --git a/dlls/wpn_shared/wpn_m95xmas.h b/dlls/wpn_shared/wpn_m95xmas.h index 81b62490c..15352020c 100644 --- a/dlls/wpn_shared/wpn_m95xmas.h +++ b/dlls/wpn_shared/wpn_m95xmas.h @@ -1,8 +1,4 @@ -#ifndef WPN_M95_H -#define WPN_M95_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,14 @@ namespace sv { class CM95xmas : public CBasePlayerWeapon { + enum m95xmas_e + { + M95_IDLE, + M95_SHOOT1, + M95_SHOOT2, + M95_RELOAD, + M95_DRAW + }; public: void Spawn() override; void Precache() override; @@ -54,5 +58,3 @@ class CM95xmas : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_mac10.cpp b/dlls/wpn_shared/wpn_mac10.cpp index 11fef0172..9458f31d6 100644 --- a/dlls/wpn_shared/wpn_mac10.cpp +++ b/dlls/wpn_shared/wpn_mac10.cpp @@ -26,16 +26,6 @@ namespace cl { namespace sv { #endif -enum mac10_e -{ - MAC10_IDLE1, - MAC10_RELOAD, - MAC10_DRAW, - MAC10_SHOOT1, - MAC10_SHOOT2, - MAC10_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_mac10, CMAC10) void CMAC10::Spawn(void) diff --git a/dlls/wpn_shared/wpn_mac10.h b/dlls/wpn_shared/wpn_mac10.h index 224950902..4cf0798cc 100644 --- a/dlls/wpn_shared/wpn_mac10.h +++ b/dlls/wpn_shared/wpn_mac10.h @@ -1,8 +1,4 @@ -#ifndef WPN_MAC10_H -#define WPN_MAC10_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CMAC10 : public CBasePlayerWeapon { + enum mac10_e + { + MAC10_IDLE1, + MAC10_RELOAD, + MAC10_DRAW, + MAC10_SHOOT1, + MAC10_SHOOT2, + MAC10_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -52,5 +57,3 @@ class CMAC10 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_mg3.cpp b/dlls/wpn_shared/wpn_mg3.cpp index f43e75a7f..bea420daa 100644 --- a/dlls/wpn_shared/wpn_mg3.cpp +++ b/dlls/wpn_shared/wpn_mg3.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum m249_e -{ - M249_IDLE1, - M249_SHOOT1, - M249_SHOOT2, - M249_RELOAD, - M249_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_mg3, CMG3) static const int MG3_AMMO_GIVE = 200; diff --git a/dlls/wpn_shared/wpn_mg3.h b/dlls/wpn_shared/wpn_mg3.h index abc413fd8..e1b9bf42f 100644 --- a/dlls/wpn_shared/wpn_mg3.h +++ b/dlls/wpn_shared/wpn_mg3.h @@ -1,8 +1,4 @@ -#ifndef WPN_MG3_H -#define WPN_MG3_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,14 @@ namespace sv { class CMG3 : public CBasePlayerWeapon { + enum m249_e + { + M249_IDLE1, + M249_SHOOT1, + M249_SHOOT2, + M249_RELOAD, + M249_DRAW + }; public: void Spawn() override; void Precache() override; @@ -49,5 +53,3 @@ class CMG3 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_mg36.cpp b/dlls/wpn_shared/wpn_mg36.cpp index 6c67208dd..542f83ffc 100644 --- a/dlls/wpn_shared/wpn_mg36.cpp +++ b/dlls/wpn_shared/wpn_mg36.cpp @@ -27,15 +27,6 @@ namespace cl { namespace sv { #endif - enum m249_e - { - M249_IDLE1, - M249_SHOOT1, - M249_SHOOT2, - M249_RELOAD, - M249_DRAW - }; - class CMG36 : public LinkWeaponTemplate::template type, @@ -50,6 +41,14 @@ namespace sv { TGetDamageDefault > { + enum m249_e + { + M249_IDLE1, + M249_SHOOT1, + M249_SHOOT2, + M249_RELOAD, + M249_DRAW + }; public: static constexpr const auto &DefaultReloadTime = 3.9s; static constexpr int ZoomFOV = 65; diff --git a/dlls/wpn_shared/wpn_mg3xmas.cpp b/dlls/wpn_shared/wpn_mg3xmas.cpp index f083a4a5b..a7a06d49e 100644 --- a/dlls/wpn_shared/wpn_mg3xmas.cpp +++ b/dlls/wpn_shared/wpn_mg3xmas.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum m249_e -{ - M249_IDLE1, - M249_SHOOT1, - M249_SHOOT2, - M249_RELOAD, - M249_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_mg3xmas, CMG3xmas) static const int MG3_AMMO_GIVE = 200; diff --git a/dlls/wpn_shared/wpn_mg3xmas.h b/dlls/wpn_shared/wpn_mg3xmas.h index 596686e47..83ebcebec 100644 --- a/dlls/wpn_shared/wpn_mg3xmas.h +++ b/dlls/wpn_shared/wpn_mg3xmas.h @@ -1,8 +1,4 @@ -#ifndef WPN_MG3_H -#define WPN_MG3_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,14 @@ namespace sv { class CMG3xmas : public CBasePlayerWeapon { + enum m249_e + { + M249_IDLE1, + M249_SHOOT1, + M249_SHOOT2, + M249_RELOAD, + M249_DRAW + }; public: void Spawn() override; void Precache() override; @@ -49,5 +53,3 @@ class CMG3xmas : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_molotov.cpp b/dlls/wpn_shared/wpn_molotov.cpp index 70d31a300..2c07a5489 100644 --- a/dlls/wpn_shared/wpn_molotov.cpp +++ b/dlls/wpn_shared/wpn_molotov.cpp @@ -189,15 +189,6 @@ namespace sv { LINK_ENTITY_TO_CLASS(molotov_explosion, CMolotovExplosion); #endif - -enum molotov_e -{ - SMOKEGRENADE_IDLE, - SMOKEGRENADE_PINPULL, - SMOKEGRENADE_THROW, - SMOKEGRENADE_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_molotov, CMolotov) void CMolotov::Spawn(void) diff --git a/dlls/wpn_shared/wpn_molotov.h b/dlls/wpn_shared/wpn_molotov.h index 138c5f11c..d0ee2bf40 100644 --- a/dlls/wpn_shared/wpn_molotov.h +++ b/dlls/wpn_shared/wpn_molotov.h @@ -1,8 +1,4 @@ -#ifndef WPN_SMOKEGRENADE_H -#define WPN_SMOKEGRENADE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,6 +12,13 @@ namespace sv { class CMolotov : public CBasePlayerWeapon { + enum molotov_e + { + SMOKEGRENADE_IDLE, + SMOKEGRENADE_PINPULL, + SMOKEGRENADE_THROW, + SMOKEGRENADE_DRAW + }; public: virtual void Spawn(); virtual void Precache(); @@ -47,5 +50,3 @@ class CMolotov : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_mp5navy.cpp b/dlls/wpn_shared/wpn_mp5navy.cpp index cd4013678..d9b00a5f2 100644 --- a/dlls/wpn_shared/wpn_mp5navy.cpp +++ b/dlls/wpn_shared/wpn_mp5navy.cpp @@ -26,16 +26,6 @@ namespace cl { namespace sv { #endif -enum mp5n_e -{ - MP5N_IDLE1, - MP5N_RELOAD, - MP5N_DRAW, - MP5N_SHOOT1, - MP5N_SHOOT2, - MP5N_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_mp5navy, CMP5N) void CMP5N::Spawn(void) diff --git a/dlls/wpn_shared/wpn_mp5navy.h b/dlls/wpn_shared/wpn_mp5navy.h index e012b6738..491e68f8f 100644 --- a/dlls/wpn_shared/wpn_mp5navy.h +++ b/dlls/wpn_shared/wpn_mp5navy.h @@ -1,8 +1,4 @@ -#ifndef WPN_MP5NAVY_H -#define WPN_MP5NAVY_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CMP5N : public CBasePlayerWeapon { + enum mp5n_e + { + MP5N_IDLE1, + MP5N_RELOAD, + MP5N_DRAW, + MP5N_SHOOT1, + MP5N_SHOOT2, + MP5N_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -52,5 +57,3 @@ class CMP5N : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_mp7a1d.cpp b/dlls/wpn_shared/wpn_mp7a1d.cpp index fe070eff5..7e24837f1 100644 --- a/dlls/wpn_shared/wpn_mp7a1d.cpp +++ b/dlls/wpn_shared/wpn_mp7a1d.cpp @@ -26,26 +26,6 @@ namespace cl { namespace sv { #endif -enum elite_e -{ - ELITE_IDLE, - ELITE_IDLE_LEFTEMPTY, - ELITE_SHOOTLEFT1, - ELITE_SHOOTLEFT2, - ELITE_SHOOTLEFT3, - ELITE_SHOOTLEFT4, - ELITE_SHOOTLEFT5, - ELITE_SHOOTLEFTLAST, - ELITE_SHOOTRIGHT1, - ELITE_SHOOTRIGHT2, - ELITE_SHOOTRIGHT3, - ELITE_SHOOTRIGHT4, - ELITE_SHOOTRIGHT5, - ELITE_SHOOTRIGHTLAST, - ELITE_RELOAD, - ELITE_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_mp7a1d, CMP7A1D) static const int WEAPON_MAXCLIP = 80; diff --git a/dlls/wpn_shared/wpn_mp7a1d.h b/dlls/wpn_shared/wpn_mp7a1d.h index fcff94ce6..e5ab7a0bb 100644 --- a/dlls/wpn_shared/wpn_mp7a1d.h +++ b/dlls/wpn_shared/wpn_mp7a1d.h @@ -1,8 +1,4 @@ -#ifndef WPN_MP7A1D_H -#define WPN_MP7A1D_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -12,6 +8,25 @@ namespace sv { class CMP7A1D : public CBasePlayerWeapon { + enum elite_e + { + ELITE_IDLE, + ELITE_IDLE_LEFTEMPTY, + ELITE_SHOOTLEFT1, + ELITE_SHOOTLEFT2, + ELITE_SHOOTLEFT3, + ELITE_SHOOTLEFT4, + ELITE_SHOOTLEFT5, + ELITE_SHOOTLEFTLAST, + ELITE_SHOOTRIGHT1, + ELITE_SHOOTRIGHT2, + ELITE_SHOOTRIGHT3, + ELITE_SHOOTRIGHT4, + ELITE_SHOOTRIGHT5, + ELITE_SHOOTRIGHTLAST, + ELITE_RELOAD, + ELITE_DRAW + }; public: void Spawn() override; void Precache() override; @@ -48,5 +63,3 @@ class CMP7A1D : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_p228.cpp b/dlls/wpn_shared/wpn_p228.cpp index c6a755066..ef22beab1 100644 --- a/dlls/wpn_shared/wpn_p228.cpp +++ b/dlls/wpn_shared/wpn_p228.cpp @@ -26,17 +26,6 @@ namespace cl { namespace sv { #endif -enum p228_e -{ - P228_IDLE, - P228_SHOOT1, - P228_SHOOT2, - P228_SHOOT3, - P228_SHOOT_EMPTY, - P228_RELOAD, - P228_DRAW -}; - enum p228_shield_e { P228_SHIELD_IDLE, diff --git a/dlls/wpn_shared/wpn_p228.h b/dlls/wpn_shared/wpn_p228.h index 27364ee13..1efa2da9e 100644 --- a/dlls/wpn_shared/wpn_p228.h +++ b/dlls/wpn_shared/wpn_p228.h @@ -1,8 +1,4 @@ -#ifndef WPN_P228_H -#define WPN_P228_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,16 @@ namespace sv { class CP228 : public CBasePlayerWeapon { + enum p228_e + { + P228_IDLE, + P228_SHOOT1, + P228_SHOOT2, + P228_SHOOT3, + P228_SHOOT_EMPTY, + P228_RELOAD, + P228_DRAW + }; public: void Spawn() override; void Precache() override; @@ -56,5 +62,3 @@ class CP228 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_p90.cpp b/dlls/wpn_shared/wpn_p90.cpp index 764605d18..af6c215f6 100644 --- a/dlls/wpn_shared/wpn_p90.cpp +++ b/dlls/wpn_shared/wpn_p90.cpp @@ -26,16 +26,6 @@ namespace cl { namespace sv { #endif -enum p90_e -{ - P90_IDLE1, - P90_RELOAD, - P90_DRAW, - P90_SHOOT1, - P90_SHOOT2, - P90_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_p90, CP90) void CP90::Spawn(void) diff --git a/dlls/wpn_shared/wpn_p90.h b/dlls/wpn_shared/wpn_p90.h index 9fdd641dc..9197be9e8 100644 --- a/dlls/wpn_shared/wpn_p90.h +++ b/dlls/wpn_shared/wpn_p90.h @@ -1,8 +1,4 @@ -#ifndef WPN_P90_H -#define WPN_P90_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CP90 : public CBasePlayerWeapon { + enum p90_e + { + P90_IDLE1, + P90_RELOAD, + P90_DRAW, + P90_SHOOT1, + P90_SHOOT2, + P90_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -52,5 +57,3 @@ class CP90 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_scarh.cpp b/dlls/wpn_shared/wpn_scarh.cpp index 8f5c35f37..ccc5a8d82 100644 --- a/dlls/wpn_shared/wpn_scarh.cpp +++ b/dlls/wpn_shared/wpn_scarh.cpp @@ -30,24 +30,6 @@ namespace cl { namespace sv { #endif -enum scar_e -{ - SCARL_IDLE1, - SCARL_RELOAD, - SCARL_DRAW, - SCARL_SHOOT1, - SCARL_SHOOT2, - SCARL_SHOOT3, - CHANGE_SCARL, - SCARH_IDLE1, - SCARH_RELOAD, - SCARH_DRAW, - SCARH_SHOOT1, - SCARH_SHOOT2, - SCARH_SHOOT3, - CHANGE_SCARH, -}; - LINK_ENTITY_TO_CLASS(weapon_scarh, CSCARHeavy) const int SCARH_AMMO = 20; diff --git a/dlls/wpn_shared/wpn_scarh.h b/dlls/wpn_shared/wpn_scarh.h index 03967d76d..0e1ccd6af 100644 --- a/dlls/wpn_shared/wpn_scarh.h +++ b/dlls/wpn_shared/wpn_scarh.h @@ -1,8 +1,4 @@ -#ifndef WPN_AK47_H -#define WPN_AK47_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -12,6 +8,23 @@ namespace sv { class CSCARHeavy : public CBasePlayerWeapon { + enum scar_e + { + SCARL_IDLE1, + SCARL_RELOAD, + SCARL_DRAW, + SCARL_SHOOT1, + SCARL_SHOOT2, + SCARL_SHOOT3, + CHANGE_SCARL, + SCARH_IDLE1, + SCARH_RELOAD, + SCARH_DRAW, + SCARH_SHOOT1, + SCARH_SHOOT2, + SCARH_SHOOT3, + CHANGE_SCARH, + }; public: void Spawn() override; void Precache() override; @@ -53,5 +66,3 @@ class CSCARHeavy : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_scarl.cpp b/dlls/wpn_shared/wpn_scarl.cpp index 80953f3e5..6ef532a0a 100644 --- a/dlls/wpn_shared/wpn_scarl.cpp +++ b/dlls/wpn_shared/wpn_scarl.cpp @@ -30,24 +30,6 @@ namespace cl { namespace sv { #endif -enum scar_e -{ - SCARL_IDLE1, - SCARL_RELOAD, - SCARL_DRAW, - SCARL_SHOOT1, - SCARL_SHOOT2, - SCARL_SHOOT3, - CHANGE_SCARL, - SCARH_IDLE1, - SCARH_RELOAD, - SCARH_DRAW, - SCARH_SHOOT1, - SCARH_SHOOT2, - SCARH_SHOOT3, - CHANGE_SCARH, -}; - LINK_ENTITY_TO_CLASS(weapon_scarl, CScarLight) const float SCARL_AMMO = 30; diff --git a/dlls/wpn_shared/wpn_scarl.h b/dlls/wpn_shared/wpn_scarl.h index 0b4967ea8..867178023 100644 --- a/dlls/wpn_shared/wpn_scarl.h +++ b/dlls/wpn_shared/wpn_scarl.h @@ -1,8 +1,4 @@ -#ifndef WPN_GALIL_H -#define WPN_GALIL_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -12,6 +8,24 @@ namespace sv { class CScarLight : public CBasePlayerWeapon { + enum scar_e + { + SCARL_IDLE1, + SCARL_RELOAD, + SCARL_DRAW, + SCARL_SHOOT1, + SCARL_SHOOT2, + SCARL_SHOOT3, + CHANGE_SCARL, + SCARH_IDLE1, + SCARH_RELOAD, + SCARH_DRAW, + SCARH_SHOOT1, + SCARH_SHOOT2, + SCARH_SHOOT3, + CHANGE_SCARH, + }; + public: void Spawn() override; void Precache() override; @@ -54,5 +68,3 @@ class CScarLight : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_scout.cpp b/dlls/wpn_shared/wpn_scout.cpp index 6bac59689..dc002d100 100644 --- a/dlls/wpn_shared/wpn_scout.cpp +++ b/dlls/wpn_shared/wpn_scout.cpp @@ -26,15 +26,6 @@ namespace cl { namespace sv { #endif -enum scout_e -{ - SCOUT_IDLE, - SCOUT_SHOOT, - SCOUT_SHOOT2, - SCOUT_RELOAD, - SCOUT_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_scout, CSCOUT) void CSCOUT::Spawn(void) diff --git a/dlls/wpn_shared/wpn_scout.h b/dlls/wpn_shared/wpn_scout.h index cd567904a..4d0109ba0 100644 --- a/dlls/wpn_shared/wpn_scout.h +++ b/dlls/wpn_shared/wpn_scout.h @@ -1,8 +1,4 @@ -#ifndef WPN_SCOUT_H -#define WPN_SCOUT_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,14 @@ namespace sv { class CSCOUT : public CBasePlayerWeapon { + enum scout_e + { + SCOUT_IDLE, + SCOUT_SHOOT, + SCOUT_SHOOT2, + SCOUT_RELOAD, + SCOUT_DRAW + }; public: void Spawn() override; void Precache() override; @@ -52,5 +56,3 @@ class CSCOUT : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_sg550.cpp b/dlls/wpn_shared/wpn_sg550.cpp index 36bd4174b..2120e69ad 100644 --- a/dlls/wpn_shared/wpn_sg550.cpp +++ b/dlls/wpn_shared/wpn_sg550.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum sg550_e -{ - SG550_IDLE, - SG550_SHOOT, - SG550_SHOOT2, - SG550_RELOAD, - SG550_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_sg550, CSG550) void CSG550::Spawn(void) diff --git a/dlls/wpn_shared/wpn_sg550.h b/dlls/wpn_shared/wpn_sg550.h index be9530407..e6dfd4ba8 100644 --- a/dlls/wpn_shared/wpn_sg550.h +++ b/dlls/wpn_shared/wpn_sg550.h @@ -1,8 +1,4 @@ -#ifndef WPN_SG550_H -#define WPN_SG550_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,14 @@ namespace sv { class CSG550 : public CBasePlayerWeapon { + enum sg550_e + { + SG550_IDLE, + SG550_SHOOT, + SG550_SHOOT2, + SG550_RELOAD, + SG550_DRAW + }; public: void Spawn() override; void Precache() override; @@ -53,5 +57,3 @@ class CSG550 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_sg552.cpp b/dlls/wpn_shared/wpn_sg552.cpp index 9e9f28b57..dea17415b 100644 --- a/dlls/wpn_shared/wpn_sg552.cpp +++ b/dlls/wpn_shared/wpn_sg552.cpp @@ -26,19 +26,6 @@ namespace cl { namespace sv { #endif -enum sg552_e -{ - SG552_IDLE1, - SG552_RELOAD, - SG552_DRAW, - SG552_SHOOT1, - SG552_SHOOT2, - SG552_SHOOT3, - SG552_INSPECT, - SG552_AIM, - SG552_BACK -}; - LINK_ENTITY_TO_CLASS(weapon_sg552, CSG552) void CSG552::Spawn(void) diff --git a/dlls/wpn_shared/wpn_sg552.h b/dlls/wpn_shared/wpn_sg552.h index 7e96ce449..c82e21b05 100644 --- a/dlls/wpn_shared/wpn_sg552.h +++ b/dlls/wpn_shared/wpn_sg552.h @@ -1,8 +1,4 @@ -#ifndef WPN_SG552_H -#define WPN_SG552_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,18 @@ namespace sv { class CSG552 : public CBasePlayerWeapon { + enum sg552_e + { + SG552_IDLE1, + SG552_RELOAD, + SG552_DRAW, + SG552_SHOOT1, + SG552_SHOOT2, + SG552_SHOOT3, + SG552_INSPECT, + SG552_AIM, + SG552_BACK + }; public: void Spawn() override; void Precache() override; @@ -58,5 +66,3 @@ class CSG552 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_sgdrill.cpp b/dlls/wpn_shared/wpn_sgdrill.cpp index 1e68affce..75808c30e 100644 --- a/dlls/wpn_shared/wpn_sgdrill.cpp +++ b/dlls/wpn_shared/wpn_sgdrill.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum sgdrill_e -{ - SGDRILL_IDLE, - SGDRILL_FIRE, - SGDRILL_SLASH, - SGDRILL_RELOAD, - SGDRILL_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_sgdrill, CSgdrill) void CSgdrill::Spawn(void) diff --git a/dlls/wpn_shared/wpn_sgdrill.h b/dlls/wpn_shared/wpn_sgdrill.h index 76cd525ed..35a82ba9a 100644 --- a/dlls/wpn_shared/wpn_sgdrill.h +++ b/dlls/wpn_shared/wpn_sgdrill.h @@ -1,8 +1,4 @@ -#ifndef WPN_XM1014_H -#define WPN_XM1014_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,11 +12,16 @@ namespace sv { #define SGDRILL_DEFAULT_GIVE 35 #define SGDRILL_MAX_CLIP 35 -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CSgdrill : public CBasePlayerWeapon { + enum sgdrill_e + { + SGDRILL_IDLE, + SGDRILL_FIRE, + SGDRILL_SLASH, + SGDRILL_RELOAD, + SGDRILL_DRAW + }; public: void Spawn() override; @@ -65,5 +66,3 @@ class CSgdrill : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_smokegrenade.cpp b/dlls/wpn_shared/wpn_smokegrenade.cpp index 8ea2ac1f1..b28d079b2 100644 --- a/dlls/wpn_shared/wpn_smokegrenade.cpp +++ b/dlls/wpn_shared/wpn_smokegrenade.cpp @@ -26,14 +26,6 @@ namespace cl { namespace sv { #endif -enum smokegrenade_e -{ - SMOKEGRENADE_IDLE, - SMOKEGRENADE_PINPULL, - SMOKEGRENADE_THROW, - SMOKEGRENADE_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_smokegrenade, CSmokeGrenade) void CSmokeGrenade::Spawn(void) diff --git a/dlls/wpn_shared/wpn_smokegrenade.h b/dlls/wpn_shared/wpn_smokegrenade.h index 54023d6e2..bf094a6ee 100644 --- a/dlls/wpn_shared/wpn_smokegrenade.h +++ b/dlls/wpn_shared/wpn_smokegrenade.h @@ -1,8 +1,4 @@ -#ifndef WPN_SMOKEGRENADE_H -#define WPN_SMOKEGRENADE_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -16,6 +12,13 @@ namespace sv { class CSmokeGrenade : public CBasePlayerWeapon { + enum smokegrenade_e + { + SMOKEGRENADE_IDLE, + SMOKEGRENADE_PINPULL, + SMOKEGRENADE_THROW, + SMOKEGRENADE_DRAW + }; public: virtual void Spawn(); virtual void Precache(); @@ -48,5 +51,3 @@ class CSmokeGrenade : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_starchaserar.cpp b/dlls/wpn_shared/wpn_starchaserar.cpp index c4821305f..a1dddb7b8 100644 --- a/dlls/wpn_shared/wpn_starchaserar.cpp +++ b/dlls/wpn_shared/wpn_starchaserar.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum starchaserar_e -{ - STARCHASERAR_IDLE1, - STARCHASERAR_RELOAD, - STARCHASERAR_DRAW, - STARCHASERAR_SHOOT1, - STARCHASERAR_SHOOT2, - STARCHASERAR_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_starchaserar, CStarchaserar) void CStarchaserar::Spawn(void) @@ -294,7 +284,7 @@ void CStarchaserar::StarchaserarFire(float flSpread, duration_t flCycleTime, BOO tDelta += gpGlobals->time - tWorldTime; } - if (tNextAttack > 1.0s || (gpGlobals->time - tWorldTime > 1.0s) || tDelta > 1.0s) //¿ÉÒÔ¶àÉäÒ»´Î + if (tNextAttack > 1.0s || (gpGlobals->time - tWorldTime > 1.0s) || tDelta > 1.0s) //���Զ���һ�� { tNextAttack = 0.0s; tDelta = 0.0s; diff --git a/dlls/wpn_shared/wpn_starchaserar.h b/dlls/wpn_shared/wpn_starchaserar.h index 2a82509af..1661b0004 100644 --- a/dlls/wpn_shared/wpn_starchaserar.h +++ b/dlls/wpn_shared/wpn_starchaserar.h @@ -1,8 +1,4 @@ -#ifndef WPN_AUG_H -#define WPN_AUG_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,15 @@ namespace sv { class CStarchaserar : public CBasePlayerWeapon { + enum starchaserar_e + { + STARCHASERAR_IDLE1, + STARCHASERAR_RELOAD, + STARCHASERAR_DRAW, + STARCHASERAR_SHOOT1, + STARCHASERAR_SHOOT2, + STARCHASERAR_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -55,5 +60,3 @@ class CStarchaserar : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_stg44.cpp b/dlls/wpn_shared/wpn_stg44.cpp index 07373d111..715e9974c 100644 --- a/dlls/wpn_shared/wpn_stg44.cpp +++ b/dlls/wpn_shared/wpn_stg44.cpp @@ -30,16 +30,6 @@ namespace cl { namespace sv { #endif -enum stg44_e -{ - STG44_IDLE1, - STG44_RELOAD, - STG44_DRAW, - STG44_SHOOT1, - STG44_SHOOT2, - STG44_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_stg44, CStg44) void CStg44::Spawn(void) diff --git a/dlls/wpn_shared/wpn_stg44.h b/dlls/wpn_shared/wpn_stg44.h index bd81e2d0f..34b4e2d4f 100644 --- a/dlls/wpn_shared/wpn_stg44.h +++ b/dlls/wpn_shared/wpn_stg44.h @@ -1,8 +1,4 @@ -#ifndef WPN_STG44_H -#define WPN_STG44_H -#ifdef _WIN32 #pragma once -#endif //Stg44 #define STG44_MAX_SPEED 221 @@ -18,6 +14,15 @@ namespace sv { class CStg44 : public CBasePlayerWeapon { + enum stg44_e + { + STG44_IDLE1, + STG44_RELOAD, + STG44_DRAW, + STG44_SHOOT1, + STG44_SHOOT2, + STG44_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -50,5 +55,3 @@ class CStg44 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_svdex.cpp b/dlls/wpn_shared/wpn_svdex.cpp index 4f22e3916..342fcf336 100644 --- a/dlls/wpn_shared/wpn_svdex.cpp +++ b/dlls/wpn_shared/wpn_svdex.cpp @@ -230,19 +230,6 @@ namespace sv { }; LINK_ENTITY_TO_CLASS(svdex_grenade, CSVDEXGrenade) #endif -enum svdex_e -{ - SVDEX_IDLEA, - SVDEX_SHOOTA, - SVDEX_RELOAD, - SVDEX_DRAWA, - SVDEX_IDLEB, - SVDEX_SHOOTB_1, - SVDEX_SHOOTB_LAST, - SVDEX_DRAWB, - SVDEX_MOVE_GRENADE, - SVDEX_MOVE_CARBINE -}; LINK_ENTITY_TO_CLASS(weapon_svdex, CSVDEX) diff --git a/dlls/wpn_shared/wpn_svdex.h b/dlls/wpn_shared/wpn_svdex.h index 9dafede5a..ed9889acf 100644 --- a/dlls/wpn_shared/wpn_svdex.h +++ b/dlls/wpn_shared/wpn_svdex.h @@ -13,11 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#ifndef WPN_SVDEX_H -#define WPN_SVDEX_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -33,6 +29,19 @@ namespace sv { class CSVDEX : public CBasePlayerWeapon { + enum svdex_e + { + SVDEX_IDLEA, + SVDEX_SHOOTA, + SVDEX_RELOAD, + SVDEX_DRAWA, + SVDEX_IDLEB, + SVDEX_SHOOTB_1, + SVDEX_SHOOTB_LAST, + SVDEX_DRAWB, + SVDEX_MOVE_GRENADE, + SVDEX_MOVE_CARBINE + }; public: void Spawn() override; void Precache() override; @@ -69,5 +78,3 @@ class CSVDEX : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_tar21.cpp b/dlls/wpn_shared/wpn_tar21.cpp index 501a6543b..caa733833 100644 --- a/dlls/wpn_shared/wpn_tar21.cpp +++ b/dlls/wpn_shared/wpn_tar21.cpp @@ -26,16 +26,6 @@ namespace cl { namespace sv { #endif -enum tar21_e -{ - TAR21_IDLE1, - TAR21_RELOAD, - TAR21_DRAW, - TAR21_SHOOT1, - TAR21_SHOOT2, - TAR21_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_tar21, CTAR21) const int TAR21_MAX_CLIP = 30; diff --git a/dlls/wpn_shared/wpn_tar21.h b/dlls/wpn_shared/wpn_tar21.h index bc8833591..c81bb52be 100644 --- a/dlls/wpn_shared/wpn_tar21.h +++ b/dlls/wpn_shared/wpn_tar21.h @@ -1,8 +1,4 @@ -#ifndef WPN_TAR21_H -#define WPN_TAR21_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CTAR21 : public CBasePlayerWeapon { + enum tar21_e + { + TAR21_IDLE1, + TAR21_RELOAD, + TAR21_DRAW, + TAR21_SHOOT1, + TAR21_SHOOT2, + TAR21_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -57,5 +62,3 @@ class CTAR21 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_tbarrel.cpp b/dlls/wpn_shared/wpn_tbarrel.cpp index ddc68d2f7..a990df076 100644 --- a/dlls/wpn_shared/wpn_tbarrel.cpp +++ b/dlls/wpn_shared/wpn_tbarrel.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum tbarrel_e -{ - ANIM_IDLE, - ANIM_FIRE1, - ANIM_FIRE2, - ANIM_RELOAD, - ANIM_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_tbarrel, CTbarrel) void CTbarrel::Spawn(void) diff --git a/dlls/wpn_shared/wpn_tbarrel.h b/dlls/wpn_shared/wpn_tbarrel.h index 03209d6b2..551f58320 100644 --- a/dlls/wpn_shared/wpn_tbarrel.h +++ b/dlls/wpn_shared/wpn_tbarrel.h @@ -1,8 +1,4 @@ -#ifndef WPN_XM1014_H -#define WPN_XM1014_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -18,6 +14,14 @@ namespace sv { class CTbarrel : public CBasePlayerWeapon { + enum tbarrel_e + { + ANIM_IDLE, + ANIM_FIRE1, + ANIM_FIRE2, + ANIM_RELOAD, + ANIM_DRAW + }; public: void Spawn() override; void Precache() override; @@ -52,5 +56,3 @@ class CTbarrel : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_thompson.cpp b/dlls/wpn_shared/wpn_thompson.cpp index fe8afa246..4b98795e5 100644 --- a/dlls/wpn_shared/wpn_thompson.cpp +++ b/dlls/wpn_shared/wpn_thompson.cpp @@ -26,15 +26,6 @@ namespace cl { namespace sv { #endif -enum thompson_e -{ - THOMPSON_IDLE, - THOMPSON_SHOOT1, - THOMPSON_SHOOT2, - THOMPSON_RELOAD, - THOMPSON_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_thompson, CTHOMPSON) const int THOMPSON_MAXCLIP = 50; diff --git a/dlls/wpn_shared/wpn_thompson.h b/dlls/wpn_shared/wpn_thompson.h index ee932afc9..939429f39 100644 --- a/dlls/wpn_shared/wpn_thompson.h +++ b/dlls/wpn_shared/wpn_thompson.h @@ -1,8 +1,4 @@ -#ifndef WPN_THOMPSON_H -#define WPN_THOMPSON_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,14 @@ namespace sv { class CTHOMPSON : public CBasePlayerWeapon { + enum thompson_e + { + THOMPSON_IDLE, + THOMPSON_SHOOT1, + THOMPSON_SHOOT2, + THOMPSON_RELOAD, + THOMPSON_DRAW + }; public: void Spawn() override; void Precache() override; @@ -53,5 +57,3 @@ class CTHOMPSON : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_tmp.cpp b/dlls/wpn_shared/wpn_tmp.cpp index be052816f..e8fd01f30 100644 --- a/dlls/wpn_shared/wpn_tmp.cpp +++ b/dlls/wpn_shared/wpn_tmp.cpp @@ -26,16 +26,6 @@ namespace cl { namespace sv { #endif -enum tmp_e -{ - TMP_IDLE1, - TMP_RELOAD, - TMP_DRAW, - TMP_SHOOT1, - TMP_SHOOT2, - TMP_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_tmp, CTMP) void CTMP::Spawn(void) diff --git a/dlls/wpn_shared/wpn_tmp.h b/dlls/wpn_shared/wpn_tmp.h index 4552e630a..3698029d5 100644 --- a/dlls/wpn_shared/wpn_tmp.h +++ b/dlls/wpn_shared/wpn_tmp.h @@ -1,8 +1,4 @@ -#ifndef WPN_TMP_H -#define WPN_TMP_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CTMP : public CBasePlayerWeapon { + enum tmp_e + { + TMP_IDLE1, + TMP_RELOAD, + TMP_DRAW, + TMP_SHOOT1, + TMP_SHOOT2, + TMP_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -53,5 +58,3 @@ class CTMP : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_ump45.cpp b/dlls/wpn_shared/wpn_ump45.cpp index d7e4abc82..15fe83f10 100644 --- a/dlls/wpn_shared/wpn_ump45.cpp +++ b/dlls/wpn_shared/wpn_ump45.cpp @@ -26,16 +26,6 @@ namespace cl { namespace sv { #endif -enum ump45_e -{ - UMP45_IDLE1, - UMP45_RELOAD, - UMP45_DRAW, - UMP45_SHOOT1, - UMP45_SHOOT2, - UMP45_SHOOT3 -}; - LINK_ENTITY_TO_CLASS(weapon_ump45, CUMP45) void CUMP45::Spawn(void) diff --git a/dlls/wpn_shared/wpn_ump45.h b/dlls/wpn_shared/wpn_ump45.h index 9d3fcc1f2..d77fe0d55 100644 --- a/dlls/wpn_shared/wpn_ump45.h +++ b/dlls/wpn_shared/wpn_ump45.h @@ -1,8 +1,4 @@ -#ifndef WPN_UMP45_H -#define WPN_UMP45_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,15 @@ namespace sv { class CUMP45 : public CBasePlayerWeapon { + enum ump45_e + { + UMP45_IDLE1, + UMP45_RELOAD, + UMP45_DRAW, + UMP45_SHOOT1, + UMP45_SHOOT2, + UMP45_SHOOT3 + }; public: void Spawn() override; void Precache() override; @@ -53,5 +58,3 @@ class CUMP45 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_usp.cpp b/dlls/wpn_shared/wpn_usp.cpp index c2722be8a..e20679572 100644 --- a/dlls/wpn_shared/wpn_usp.cpp +++ b/dlls/wpn_shared/wpn_usp.cpp @@ -26,39 +26,6 @@ namespace cl { namespace sv { #endif -enum usp_e -{ - USP_IDLE, - USP_SHOOT1, - USP_SHOOT2, - USP_SHOOT3, - USP_SHOOT_EMPTY, - USP_RELOAD, - USP_DRAW, - USP_ATTACH_SILENCER, - USP_UNSIL_IDLE, - USP_UNSIL_SHOOT1, - USP_UNSIL_SHOOT2, - USP_UNSIL_SHOOT3, - USP_UNSIL_SHOOT_EMPTY, - USP_UNSIL_RELOAD, - USP_UNSIL_DRAW, - USP_DETACH_SILENCER -}; - -enum usp_shield_e -{ - USP_SHIELD_IDLE, - USP_SHIELD_SHOOT1, - USP_SHIELD_SHOOT2, - USP_SHIELD_SHOOT_EMPTY, - USP_SHIELD_RELOAD, - USP_SHIELD_DRAW, - USP_SHIELD_UP_IDLE, - USP_SHIELD_UP, - USP_SHIELD_DOWN -}; - LINK_ENTITY_TO_CLASS(weapon_usp, CUSP) void CUSP::Spawn(void) diff --git a/dlls/wpn_shared/wpn_usp.h b/dlls/wpn_shared/wpn_usp.h index ab12ccc7a..b3e353d11 100644 --- a/dlls/wpn_shared/wpn_usp.h +++ b/dlls/wpn_shared/wpn_usp.h @@ -1,8 +1,4 @@ -#ifndef WPN_USP_H -#define WPN_USP_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -20,6 +16,39 @@ namespace sv { class CUSP : public CBasePlayerWeapon { + enum usp_e + { + USP_IDLE, + USP_SHOOT1, + USP_SHOOT2, + USP_SHOOT3, + USP_SHOOT_EMPTY, + USP_RELOAD, + USP_DRAW, + USP_ATTACH_SILENCER, + USP_UNSIL_IDLE, + USP_UNSIL_SHOOT1, + USP_UNSIL_SHOOT2, + USP_UNSIL_SHOOT3, + USP_UNSIL_SHOOT_EMPTY, + USP_UNSIL_RELOAD, + USP_UNSIL_DRAW, + USP_DETACH_SILENCER + }; + + enum usp_shield_e + { + USP_SHIELD_IDLE, + USP_SHIELD_SHOOT1, + USP_SHIELD_SHOOT2, + USP_SHIELD_SHOOT_EMPTY, + USP_SHIELD_RELOAD, + USP_SHIELD_DRAW, + USP_SHIELD_UP_IDLE, + USP_SHIELD_UP, + USP_SHIELD_DOWN + }; + public: void Spawn() override; void Precache() override; @@ -56,5 +85,3 @@ class CUSP : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_voidpistol.cpp b/dlls/wpn_shared/wpn_voidpistol.cpp index 475a92b17..e3604eb59 100644 --- a/dlls/wpn_shared/wpn_voidpistol.cpp +++ b/dlls/wpn_shared/wpn_voidpistol.cpp @@ -25,17 +25,17 @@ #include "gamemode/mods.h" #endif -enum blackhole_anim -{ - BLACKHOLE_START, - BLACKHOLE_LOOP, - BLACKHOLE_END - }; #ifndef CLIENT_DLL namespace sv { class CVoidpistolBlackhole : public CBaseEntity { + enum blackhole_anim + { + BLACKHOLE_START, + BLACKHOLE_LOOP, + BLACKHOLE_END + }; public: void Spawn() override { @@ -387,35 +387,6 @@ namespace cl { namespace sv { #endif - -enum voidpistol_e -{ - VOIDPISTOL_IDLEA, - VOIDPISTOL_IDLEB, - VOIDPISTOL_IDLEC, - VOIDPISTOL_SHOOTA, - VOIDPISTOL_SHOOTB, - VOIDPISTOL_SHOOTC, - VOIDPISTOL_SHOOT_BLACKHOLE_A, - VOIDPISTOL_SHOOT_BLACKHOLE_B, - VOIDPISTOL_RELOADA, - VOIDPISTOL_RELOADB, - VOIDPISTOL_RELOADC, - VOIDPISTOL_SCANNING_ON, - VOIDPISTOL_SCANNING_OFF, - VOIDPISTOL_CHANGEAC, - VOIDPISTOL_CHANGEBC, - VOIDPISTOL_DRAWA, - VOIDPISTOL_DRAWB, - VOIDPISTOL_DRAWC -}; - -enum voidpistol_mode -{ - VOIDPISTOL_MODEA, - VOIDPISTOL_MODEB, -}; - LINK_ENTITY_TO_CLASS(weapon_voidpistol, CVoidpistol) void CVoidpistol::Spawn(void) diff --git a/dlls/wpn_shared/wpn_voidpistol.h b/dlls/wpn_shared/wpn_voidpistol.h index e5ef8f803..77ef6accf 100644 --- a/dlls/wpn_shared/wpn_voidpistol.h +++ b/dlls/wpn_shared/wpn_voidpistol.h @@ -1,8 +1,4 @@ -#ifndef WPN_VOIDPISTOL_H -#define WPN_VOIDPISTOL_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -21,6 +17,32 @@ namespace sv { class CVoidpistol : public CBasePlayerWeapon { + enum voidpistol_e + { + VOIDPISTOL_IDLEA, + VOIDPISTOL_IDLEB, + VOIDPISTOL_IDLEC, + VOIDPISTOL_SHOOTA, + VOIDPISTOL_SHOOTB, + VOIDPISTOL_SHOOTC, + VOIDPISTOL_SHOOT_BLACKHOLE_A, + VOIDPISTOL_SHOOT_BLACKHOLE_B, + VOIDPISTOL_RELOADA, + VOIDPISTOL_RELOADB, + VOIDPISTOL_RELOADC, + VOIDPISTOL_SCANNING_ON, + VOIDPISTOL_SCANNING_OFF, + VOIDPISTOL_CHANGEAC, + VOIDPISTOL_CHANGEBC, + VOIDPISTOL_DRAWA, + VOIDPISTOL_DRAWB, + VOIDPISTOL_DRAWC + }; + enum voidpistol_mode + { + VOIDPISTOL_MODEA, + VOIDPISTOL_MODEB, + }; public: void Spawn() override; void Precache() override; @@ -69,5 +91,3 @@ class CVoidpistol : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_wa2000.cpp b/dlls/wpn_shared/wpn_wa2000.cpp index 020df3665..dba7a8c09 100644 --- a/dlls/wpn_shared/wpn_wa2000.cpp +++ b/dlls/wpn_shared/wpn_wa2000.cpp @@ -30,15 +30,6 @@ namespace cl { namespace sv { #endif -enum wa2000_e -{ - WA2000_IDLE, - WA2000_SHOOT, - WA2000_SHOOT2, - WA2000_RELOAD, - WA2000_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_wa2000, CWA2000) const int WA2000_MAX_CLIP = 12; diff --git a/dlls/wpn_shared/wpn_wa2000.h b/dlls/wpn_shared/wpn_wa2000.h index 22f74a391..dab4d70d1 100644 --- a/dlls/wpn_shared/wpn_wa2000.h +++ b/dlls/wpn_shared/wpn_wa2000.h @@ -1,8 +1,4 @@ -#ifndef WPN_WA2000_H -#define WPN_WA2000_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -19,6 +15,14 @@ namespace sv { class CWA2000 : public CBasePlayerWeapon { + enum wa2000_e + { + WA2000_IDLE, + WA2000_SHOOT, + WA2000_SHOOT2, + WA2000_RELOAD, + WA2000_DRAW + }; public: void Spawn() override; void Precache() override; @@ -52,5 +56,3 @@ class CWA2000 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_xm1014.cpp b/dlls/wpn_shared/wpn_xm1014.cpp index a68f1f14c..96a7ffeeb 100644 --- a/dlls/wpn_shared/wpn_xm1014.cpp +++ b/dlls/wpn_shared/wpn_xm1014.cpp @@ -26,17 +26,6 @@ namespace cl { namespace sv { #endif -enum xm1014_e -{ - XM1014_IDLE, - XM1014_FIRE1, - XM1014_FIRE2, - XM1014_RELOAD, - XM1014_PUMP, - XM1014_START_RELOAD, - XM1014_DRAW -}; - LINK_ENTITY_TO_CLASS(weapon_xm1014, CXM1014) void CXM1014::Spawn(void) diff --git a/dlls/wpn_shared/wpn_xm1014.h b/dlls/wpn_shared/wpn_xm1014.h index 9f4adfb11..b435bf85a 100644 --- a/dlls/wpn_shared/wpn_xm1014.h +++ b/dlls/wpn_shared/wpn_xm1014.h @@ -1,8 +1,4 @@ -#ifndef WPN_XM1014_H -#define WPN_XM1014_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -17,6 +13,16 @@ namespace sv { class CXM1014 : public CBasePlayerWeapon { + enum xm1014_e + { + XM1014_IDLE, + XM1014_FIRE1, + XM1014_FIRE2, + XM1014_RELOAD, + XM1014_PUMP, + XM1014_START_RELOAD, + XM1014_DRAW + }; public: void Spawn() override; void Precache() override; @@ -48,5 +54,3 @@ class CXM1014 : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/wpn_xm8s.h b/dlls/wpn_shared/wpn_xm8s.h index b6858645e..baa3bf4cd 100644 --- a/dlls/wpn_shared/wpn_xm8s.h +++ b/dlls/wpn_shared/wpn_xm8s.h @@ -1,8 +1,4 @@ -#ifndef WPN_SG550_H -#define WPN_SG550_H -#ifdef _WIN32 #pragma once -#endif #include "weapons/WeaponTemplate.hpp" @@ -94,5 +90,3 @@ class CXM8SharpShooter : public LinkWeaponTemplate::template type, @@ -164,119 +162,6 @@ void CKnifeFrequency9::PrimaryAttack(void) m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2s; } -#ifndef CLIENT_DLL -enum hit_result_t -{ - HIT_NONE, - HIT_WALL, - HIT_PLAYER, -}; -static inline hit_result_t KnifeAttack3(Vector vecSrc, Vector vecDir, float flDamage, float flRadius, float flAngleDegrees, int bitsDamageType, entvars_t *pevInflictor, entvars_t *pevAttacker) -{ - TraceResult tr; - hit_result_t result = HIT_NONE; - - vecSrc.z += 1; - - if (!pevAttacker) - pevAttacker = pevInflictor; - - Vector vecEnd = vecSrc + vecDir.Normalize() * flAngleDegrees; - UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pevAttacker), &tr); - - if (tr.flFraction >= 1) - { - UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT(pevAttacker), &tr); - - if (tr.flFraction < 1) - { - CBaseEntity *pHit = CBaseEntity::Instance(tr.pHit); - - if (!pHit || pHit->IsBSPModel()) - { - FindHullIntersection(vecSrc, tr, VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX, ENT(pevAttacker)); - } - - vecEnd = tr.vecEndPos; - } - } - - if (tr.flFraction < 1) - { - CBaseEntity *pHit = CBaseEntity::Instance(tr.pHit); - if (pHit && pHit->IsBSPModel() && pHit->pev->takedamage != DAMAGE_NO) - { - const float flAdjustedDamage = flDamage; - ClearMultiDamage(); - pHit->TraceAttack(pevInflictor, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - } - - float flVol = 1; - BOOL fHitWorld = TRUE; - if (pHit && pHit->Classify() != CLASS_NONE && pHit->Classify() != CLASS_MACHINE) - { - flVol = 0.1f; - fHitWorld = FALSE; - } - - if (fHitWorld) - { - TEXTURETYPE_PlaySound(&tr, vecSrc, vecSrc + (vecEnd - vecSrc) * 2, BULLET_PLAYER_CROWBAR); - result = HIT_WALL; - } - } - - CBaseEntity *pEntity = nullptr; - while ((pEntity = UTIL_FindEntityInSphere(pEntity, vecSrc, flRadius)) != nullptr) - { - if (pEntity->pev->takedamage != DAMAGE_NO) - { - if (pEntity->IsBSPModel()) - continue; - - if (pEntity->pev == pevAttacker) - continue; - - Vector vecSpot = pEntity->BodyTarget(vecSrc); - vecSpot.z = vecEnd.z; - UTIL_TraceLine(vecSrc, vecSpot, missile, ENT(pevInflictor), &tr); - - if (AngleBetweenVectors(tr.vecEndPos - vecSrc, vecDir) > flAngleDegrees) - continue; - - if (tr.flFraction == 1.0f || tr.pHit == pEntity->edict()) - { - if (tr.fStartSolid) - { - tr.vecEndPos = vecSrc; - tr.flFraction = 0; - } - - if (tr.flFraction == 1.0f) - { - pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); - } - - Vector vecRealDir = (tr.vecEndPos - vecSrc).Normalize(); - - UTIL_MakeVectors(pEntity->pev->angles); - if (DotProduct(vecRealDir.Make2D(), gpGlobals->v_forward.Make2D()) > 0.8) - flDamage *= 3.0; - - ClearMultiDamage(); - pEntity->TraceAttack(pevInflictor, flDamage, vecRealDir, &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - - result = HIT_PLAYER; - } - } - } - - return result; -} -#endif - void CKnifeFrequency9::DelayPrimaryAttack() { BOOL fDidHit = FALSE; diff --git a/dlls/wpn_shared/z4b_cannonplasma.cpp b/dlls/wpn_shared/z4b_cannonplasma.cpp index d8b820cd5..90fbbb56b 100644 --- a/dlls/wpn_shared/z4b_cannonplasma.cpp +++ b/dlls/wpn_shared/z4b_cannonplasma.cpp @@ -19,10 +19,10 @@ GNU General Public License for more details. #include "player.h" #include "weapons.h" #include "z4b_cannonplasma.h" +#include "weapons/KnifeAttack.h" #ifndef CLIENT_DLL #include "soundent.h" -#include "monsters.h" #include "gamemode/mods.h" #endif @@ -34,93 +34,6 @@ namespace sv { LINK_ENTITY_TO_CLASS(z4b_cannonplasma, CCannonPlasma) -#ifndef CLIENT_DLL -static inline Vector KnifeAttack2(Vector vecSrc, Vector vecDir, float flDamage, float flRadius, float flAngleDegrees, int bitsDamageType, entvars_t *pevInflictor, entvars_t *pevAttacker) -{ - TraceResult tr; - - const float falloff = flRadius ? flDamage / flRadius : 1; - const int bInWater = (UTIL_PointContents(vecSrc) == CONTENTS_WATER); - - vecSrc.z += 1; - - if (!pevAttacker) - pevAttacker = pevInflictor; - - Vector vecEnd = vecSrc + vecDir.Normalize() * flAngleDegrees; - UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pevAttacker), &tr); - - if (tr.flFraction >= 1) - { - UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT(pevAttacker), &tr); - - if (tr.flFraction < 1) - { - CBaseEntity *pHit = CBaseEntity::Instance(tr.pHit); - - if (pHit && pHit->IsBSPModel() && pHit->pev->takedamage != DAMAGE_NO) - { - float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; - ClearMultiDamage(); - pHit->TraceAttack(pevInflictor, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - } - vecEnd = tr.vecEndPos; - } - } - - CBaseEntity *pEntity = NULL; - while ((pEntity = UTIL_FindEntityInSphere(pEntity, vecSrc, flRadius)) != NULL) - { - if (pEntity->pev->takedamage != DAMAGE_NO) - { - if (bInWater && !pEntity->pev->waterlevel) - continue; - - if (!bInWater && pEntity->pev->waterlevel == 3) - continue; - - if (pEntity->IsBSPModel()) - continue; - - if (pEntity->pev == pevAttacker) - continue; - - Vector vecSpot = pEntity->BodyTarget(vecSrc); - UTIL_TraceLine(vecSrc, vecSpot, missile, ENT(pevInflictor), &tr); - - if (AngleBetweenVectors(tr.vecEndPos - vecSrc, vecDir) > flAngleDegrees) - continue; - - if (tr.flFraction == 1.0f || tr.pHit == pEntity->edict()) - { - if (tr.fStartSolid) - { - tr.vecEndPos = vecSrc; - tr.flFraction = 0; - } - - float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; - flAdjustedDamage = Q_max(0, flAdjustedDamage); - - if (tr.flFraction == 1.0f) - { - pEntity->TakeDamage(pevInflictor, pevAttacker, flAdjustedDamage, bitsDamageType); - } - else - { - tr.iHitgroup = HITGROUP_CHEST; - ClearMultiDamage(); - pEntity->TraceAttack(pevAttacker, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - } - } - } - } - return vecDir; -} -#endif - void CCannonPlasma::Spawn(void) { Base::Spawn(); diff --git a/dlls/wpn_shared/z4b_cannontiger.cpp b/dlls/wpn_shared/z4b_cannontiger.cpp index dc966d78c..6a8663187 100644 --- a/dlls/wpn_shared/z4b_cannontiger.cpp +++ b/dlls/wpn_shared/z4b_cannontiger.cpp @@ -19,10 +19,10 @@ GNU General Public License for more details. #include "player.h" #include "weapons.h" #include "z4b_cannontiger.h" +#include "weapons/KnifeAttack.h" #ifndef CLIENT_DLL #include "soundent.h" -#include "monsters.h" #include "gamemode/mods.h" #endif @@ -34,93 +34,6 @@ namespace sv { LINK_ENTITY_TO_CLASS(z4b_cannontiger, CCannonTiger) -#ifndef CLIENT_DLL -static inline Vector KnifeAttack2(Vector vecSrc, Vector vecDir, float flDamage, float flRadius, float flAngleDegrees, int bitsDamageType, entvars_t *pevInflictor, entvars_t *pevAttacker) -{ - TraceResult tr; - - const float falloff = flRadius ? flDamage / flRadius : 1; - const int bInWater = (UTIL_PointContents(vecSrc) == CONTENTS_WATER); - - vecSrc.z += 1; - - if (!pevAttacker) - pevAttacker = pevInflictor; - - Vector vecEnd = vecSrc + vecDir.Normalize() * flAngleDegrees; - UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pevAttacker), &tr); - - if (tr.flFraction >= 1) - { - UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT(pevAttacker), &tr); - - if (tr.flFraction < 1) - { - CBaseEntity *pHit = CBaseEntity::Instance(tr.pHit); - - if (pHit && pHit->IsBSPModel() && pHit->pev->takedamage != DAMAGE_NO) - { - float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; - ClearMultiDamage(); - pHit->TraceAttack(pevInflictor, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - } - vecEnd = tr.vecEndPos; - } - } - - CBaseEntity *pEntity = NULL; - while ((pEntity = UTIL_FindEntityInSphere(pEntity, vecSrc, flRadius)) != NULL) - { - if (pEntity->pev->takedamage != DAMAGE_NO) - { - if (bInWater && !pEntity->pev->waterlevel) - continue; - - if (!bInWater && pEntity->pev->waterlevel == 3) - continue; - - if (pEntity->IsBSPModel()) - continue; - - if (pEntity->pev == pevAttacker) - continue; - - Vector vecSpot = pEntity->BodyTarget(vecSrc); - UTIL_TraceLine(vecSrc, vecSpot, missile, ENT(pevInflictor), &tr); - - if (AngleBetweenVectors(tr.vecEndPos - vecSrc, vecDir) > flAngleDegrees) - continue; - - if (tr.flFraction == 1.0f || tr.pHit == pEntity->edict()) - { - if (tr.fStartSolid) - { - tr.vecEndPos = vecSrc; - tr.flFraction = 0; - } - - float flAdjustedDamage = flDamage - (tr.vecEndPos - vecSrc).Length() * falloff; - flAdjustedDamage = Q_max(0, flAdjustedDamage); - - if (tr.flFraction == 1.0f) - { - pEntity->TakeDamage(pevInflictor, pevAttacker, flAdjustedDamage, bitsDamageType); - } - else - { - tr.iHitgroup = HITGROUP_CHEST; - ClearMultiDamage(); - pEntity->TraceAttack(pevAttacker, flAdjustedDamage, (tr.vecEndPos - vecSrc).Normalize(), &tr, bitsDamageType); - ApplyMultiDamage(pevInflictor, pevAttacker); - } - } - } - } - return vecDir; -} -#endif - void CCannonTiger::Spawn(void) { Base::Spawn(); diff --git a/dlls/wpn_shared/z4b_dmp7a1x.cpp b/dlls/wpn_shared/z4b_dmp7a1x.cpp index 62528cb84..291dfe463 100644 --- a/dlls/wpn_shared/z4b_dmp7a1x.cpp +++ b/dlls/wpn_shared/z4b_dmp7a1x.cpp @@ -30,26 +30,6 @@ namespace cl { namespace sv { #endif -enum elite_e -{ - ELITE_IDLE, - ELITE_IDLE_LEFTEMPTY, - ELITE_SHOOTLEFT1, - ELITE_SHOOTLEFT2, - ELITE_SHOOTLEFT3, - ELITE_SHOOTLEFT4, - ELITE_SHOOTLEFT5, - ELITE_SHOOTLEFTLAST, - ELITE_SHOOTRIGHT1, - ELITE_SHOOTRIGHT2, - ELITE_SHOOTRIGHT3, - ELITE_SHOOTRIGHT4, - ELITE_SHOOTRIGHT5, - ELITE_SHOOTRIGHTLAST, - ELITE_RELOAD, - ELITE_DRAW -}; - LINK_ENTITY_TO_CLASS(z4b_dmp7a1x, CZ4B_MP7A1DX) static const int WEAPON_MAXCLIP = 80; diff --git a/dlls/wpn_shared/z4b_dmp7a1x.h b/dlls/wpn_shared/z4b_dmp7a1x.h index a7a695237..cb2340b4d 100644 --- a/dlls/wpn_shared/z4b_dmp7a1x.h +++ b/dlls/wpn_shared/z4b_dmp7a1x.h @@ -27,6 +27,25 @@ namespace sv { class CZ4B_MP7A1DX : public CBasePlayerWeapon { + enum elite_e + { + ELITE_IDLE, + ELITE_IDLE_LEFTEMPTY, + ELITE_SHOOTLEFT1, + ELITE_SHOOTLEFT2, + ELITE_SHOOTLEFT3, + ELITE_SHOOTLEFT4, + ELITE_SHOOTLEFT5, + ELITE_SHOOTLEFTLAST, + ELITE_SHOOTRIGHT1, + ELITE_SHOOTRIGHT2, + ELITE_SHOOTRIGHT3, + ELITE_SHOOTRIGHT4, + ELITE_SHOOTRIGHT5, + ELITE_SHOOTRIGHTLAST, + ELITE_RELOAD, + ELITE_DRAW + }; public: void Spawn() override; void Precache() override; diff --git a/dlls/wpn_shared/z4b_facelessvoid.cpp b/dlls/wpn_shared/z4b_facelessvoid.cpp index 952f0fbfa..aa6b92a9a 100644 --- a/dlls/wpn_shared/z4b_facelessvoid.cpp +++ b/dlls/wpn_shared/z4b_facelessvoid.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeFacelessVoid: public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/z4b_infinityx.h b/dlls/wpn_shared/z4b_infinityx.h index 87e3fe013..d410df3fa 100644 --- a/dlls/wpn_shared/z4b_infinityx.h +++ b/dlls/wpn_shared/z4b_infinityx.h @@ -13,11 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#ifndef WPN_DEAGLED_H -#define WPN_DEAGLED_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -95,5 +91,3 @@ class CInfinityX : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/z4b_lc_sword.cpp b/dlls/wpn_shared/z4b_lc_sword.cpp index 4bfa0ee9d..21d2b800b 100644 --- a/dlls/wpn_shared/z4b_lc_sword.cpp +++ b/dlls/wpn_shared/z4b_lc_sword.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeLcSword: public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/z4b_m4a1razer.cpp b/dlls/wpn_shared/z4b_m4a1razer.cpp index 3abf4362a..63ab12f96 100644 --- a/dlls/wpn_shared/z4b_m4a1razer.cpp +++ b/dlls/wpn_shared/z4b_m4a1razer.cpp @@ -221,20 +221,6 @@ namespace sv { }; LINK_ENTITY_TO_CLASS(m4a1razer_grenade, CM4A1RazerGrenade) #endif -enum -{ - ANIM_IDLEB = 0, - ANIM_SHOOTB1, - ANIM_SHOOTB2, - ANIM_RELOADB, - ANIM_DRAWB, - ANIM_CHANGEA, - ANIM_IDLE, - ANIM_SHOOT, - ANIM_RELOAD, - ANIM_DRAW, - ANIM_CHANGEB, -}; LINK_ENTITY_TO_CLASS(z4b_m4a1razer, CM4A1Razer) diff --git a/dlls/wpn_shared/z4b_m4a1razer.h b/dlls/wpn_shared/z4b_m4a1razer.h index 86c7279e5..bd47dc7be 100644 --- a/dlls/wpn_shared/z4b_m4a1razer.h +++ b/dlls/wpn_shared/z4b_m4a1razer.h @@ -13,11 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#ifndef WPN_M4A1RAZER_H -#define WPN_M4A1RAZER_H -#ifdef _WIN32 #pragma once -#endif #ifdef CLIENT_DLL namespace cl { @@ -27,6 +23,20 @@ namespace sv { class CM4A1Razer : public CBasePlayerWeapon { + enum m4a1razer_e + { + ANIM_IDLEB = 0, + ANIM_SHOOTB1, + ANIM_SHOOTB2, + ANIM_RELOADB, + ANIM_DRAWB, + ANIM_CHANGEA, + ANIM_IDLE, + ANIM_SHOOT, + ANIM_RELOAD, + ANIM_DRAW, + ANIM_CHANGEB, + }; public: void Spawn() override; void Precache() override; @@ -63,5 +73,3 @@ class CM4A1Razer : public CBasePlayerWeapon }; } - -#endif \ No newline at end of file diff --git a/dlls/wpn_shared/z4b_nataknifedx.cpp b/dlls/wpn_shared/z4b_nataknifedx.cpp index 420dc4847..1da861acd 100644 --- a/dlls/wpn_shared/z4b_nataknifedx.cpp +++ b/dlls/wpn_shared/z4b_nataknifedx.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeNataKnifeDX: public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/z4b_oppovivo.cpp b/dlls/wpn_shared/z4b_oppovivo.cpp index a80b4eb90..5d1e5dd9a 100644 --- a/dlls/wpn_shared/z4b_oppovivo.cpp +++ b/dlls/wpn_shared/z4b_oppovivo.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeOppoVivo: public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/z4b_stormgiantx.cpp b/dlls/wpn_shared/z4b_stormgiantx.cpp index a009ef8e8..dfd7e979f 100644 --- a/dlls/wpn_shared/z4b_stormgiantx.cpp +++ b/dlls/wpn_shared/z4b_stormgiantx.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeStormgiantX: public LinkWeaponTemplate::template type, diff --git a/dlls/wpn_shared/z4b_strongknifex.cpp b/dlls/wpn_shared/z4b_strongknifex.cpp index 8796a5bfe..a88b20626 100644 --- a/dlls/wpn_shared/z4b_strongknifex.cpp +++ b/dlls/wpn_shared/z4b_strongknifex.cpp @@ -31,9 +31,6 @@ namespace cl { namespace sv { #endif -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 - class CKnifeStrongKnifeX: public LinkWeaponTemplate::template type, diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index ad954daa5..ec1bea7fb 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -354,11 +354,6 @@ endif() add_definitions(-DXASH_FORCEINLINE) -# Important, as HLSDK and engine shares some symbol names! -if(NOT WIN32) # Windows by default have hidden visibility and better linker - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") -endif() - # ----- Conditions ----- if(XASH_VECTORIZE_SINCOS) # I know what I am doing and I want to build version that requires SSE @@ -432,7 +427,7 @@ endif() if(XASH_SDL) set(SDL2_BUILDING_EXECUTABLE ${XASH_SINGLE_BINARY}) # link sdl2main, if needed add_definitions(-DXASH_SDL) - + target_link_libraries(${XASH_ENGINE} sdl2) endif() @@ -528,6 +523,9 @@ else() endif() endif() +# engine doesnt support unity build now +set_target_properties(${XASH_ENGINE} PROPERTIES UNITY_BUILD OFF) + if( NOT XASH_STATIC_GAMELIB ) install( TARGETS ${XASH_ENGINE} DESTINATION ".") endif() \ No newline at end of file diff --git a/engine/client/imgui_impl_xash.cpp b/engine/client/imgui_impl_xash.cpp index a88ab9e02..d5e980f5d 100644 --- a/engine/client/imgui_impl_xash.cpp +++ b/engine/client/imgui_impl_xash.cpp @@ -23,6 +23,7 @@ extern "C" { #include "minmax.h" #include "imgui.h" +#include "imgui_internal.h" #include "imgui_impl_xash.h" #include "imgui_lcsm_warning.h" #include "imgui_console.h" @@ -56,11 +57,6 @@ ImGuiContext* g_EngineContext = nullptr; bool g_bShowDemoWindow = false; -template static inline T ImLerp(T a, T b, float t) { return (T)(a + (b - a) * t); } -static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) { return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); } -static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); } -static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); } - // This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure) void ImGui_ImplGL_RenderDrawLists(ImDrawData* draw_data) { diff --git a/engine/client/imgui_sprview.cpp b/engine/client/imgui_sprview.cpp index 42f41327c..af2dd7b76 100644 --- a/engine/client/imgui_sprview.cpp +++ b/engine/client/imgui_sprview.cpp @@ -28,160 +28,176 @@ extern "C" { #include #include #include +#include #undef HSPRITE - - -static bool enabled = false; -static std::vector recent_open; - -static HSPRITE g_spr = 0; -static int cur_frame = 0; -static float last_update; -static float framerate = 15; -static bool playing = true; -static bool loop = true; - -static void OpenFile(std::string abs_path) +class ImGui_SprView { - FS_AllowDirectPaths(true); + bool enabled = false; + std::vector recent_open; + HSPRITE g_spr = 0; + int cur_frame = 0; + float last_update; + float framerate = 15; + bool playing = true; + bool loop = true; +public: + void OpenFile(std::string abs_path) + { + FS_AllowDirectPaths(true); - g_spr = pfnSPR_Load(abs_path.c_str()); + g_spr = pfnSPR_Load(abs_path.c_str()); - FS_AllowDirectPaths(false); + FS_AllowDirectPaths(false); - cur_frame = 0; - last_update = 0; + cur_frame = 0; + last_update = 0; - if (std::find(recent_open.begin(), recent_open.end(), abs_path) == recent_open.end()) - recent_open.emplace_back(std::move(abs_path)); - if (recent_open.size() > 5) - recent_open.erase(recent_open.begin(), recent_open.end() - 5); -} + if (std::find(recent_open.begin(), recent_open.end(), abs_path) == recent_open.end()) + recent_open.emplace_back(std::move(abs_path)); + if (recent_open.size() > 5) + recent_open.erase(recent_open.begin(), recent_open.end() - 5); + } -static void Con_SprView_f() -{ - enabled = true; + static void Con_SprView_f(); - if (Cmd_Argc() >= 2) + void Init() { - OpenFile(Cmd_Argv(1)); + Cmd_AddCommand("sprview", Con_SprView_f, "open sprview"); } -} - -void ImGui_SprView_Init() -{ - Cmd_AddCommand("sprview", Con_SprView_f, "open sprview"); -} - -void ImGui_SprView_OnGUI(void) -{ - if (!enabled) - return; - int spr = g_spr; - int frameWidth = 0, frameHeight = 0, numFrames = 0; - int texture = 0; - if (spr) + void OnGUI(void) { - model_t* pSprite = &clgame.sprites[spr]; - R_GetSpriteParms(&frameWidth, &frameHeight, &numFrames, cur_frame, pSprite); - texture = R_GetSpriteTexture(pSprite, cur_frame); + if (!enabled) + return; - if (!texture) + int spr = g_spr; + int frameWidth = 0, frameHeight = 0, numFrames = 0; + int texture = 0; + if (spr) { - fs_offset_t size; - byte* buf = FS_LoadFile(pSprite->name, &size, false); + model_t* pSprite = &clgame.sprites[spr]; + R_GetSpriteParms(&frameWidth, &frameHeight, &numFrames, cur_frame, pSprite); + texture = R_GetSpriteTexture(pSprite, cur_frame); + + if (!texture) + { + fs_offset_t size; + byte* buf = FS_LoadFile(pSprite->name, &size, false); - qboolean loaded; - Mod_LoadSpriteModel(pSprite, buf, &loaded, 0); + qboolean loaded; + Mod_LoadSpriteModel(pSprite, buf, &loaded, 0); + } } - } - if (ImGui::Begin("SprView", &enabled, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_MenuBar)) - { - if (ImGui::BeginMenuBar()) + if (ImGui::Begin("SprView", &enabled, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_MenuBar)) { - if (ImGui::BeginMenu("File")) + if (ImGui::BeginMenuBar()) { - if (ImGui::MenuItem("Open File")) + if (ImGui::BeginMenu("File")) { - igfd::ImGuiFileDialog::Instance()->OpenModal("SprView - Open", "SprView - Open", ".spr", "."); - } + if (ImGui::MenuItem("Open File")) + { + igfd::ImGuiFileDialog::Instance()->OpenModal("SprView - Open", "SprView - Open", ".spr", "."); + } - if (ImGui::MenuItem("Close File")) - { - g_spr = 0; - cur_frame = 0; - last_update = 0; - } + if (ImGui::MenuItem("Close File")) + { + g_spr = 0; + cur_frame = 0; + last_update = 0; + } - if (ImGui::BeginMenu("Open Recent")) - { - for (auto& file : recent_open) + if (ImGui::BeginMenu("Open Recent")) { - if (ImGui::MenuItem(file.c_str())) + for (auto& file : recent_open) { - OpenFile(file); + if (ImGui::MenuItem(file.c_str())) + { + OpenFile(file); + } } + ImGui::EndMenu(); + } + + if (ImGui::MenuItem("Quit")) + { + enabled = false; } ImGui::EndMenu(); } - - if (ImGui::MenuItem("Quit")) + if (ImGui::BeginMenu("View")) { - enabled = false; + ImGui::MenuItem("Playing", "", &playing); + ImGui::MenuItem("Loop", "", &loop); + ImGui::DragFloat("Framerate", &framerate, 0.2f, 1.0f, std::numeric_limits::max(), "%.0f fps"); + + ImGui::SliderInt("Current Frame", &cur_frame, 0, numFrames - 1); + + ImGui::EndMenu(); } - ImGui::EndMenu(); + ImGui::EndMenuBar(); } - if (ImGui::BeginMenu("View")) + + if (spr) { - ImGui::MenuItem("Playing", "", &playing); - ImGui::MenuItem("Loop", "", &loop); - ImGui::DragFloat("Framerate", &framerate, 0.2f, 1.0f, std::numeric_limits::max(), "%.0f fps"); + auto [x1, y1] = ImGui::GetWindowContentRegionMin(); + auto [x2, y2] = ImGui::GetWindowContentRegionMax(); + + if (playing && ImGui::GetTime() > last_update + 1 / framerate) + { + if(loop) + cur_frame = ++cur_frame % numFrames; + else + cur_frame = std::min(cur_frame + 1, numFrames - 1); - ImGui::SliderInt("Current Frame", &cur_frame, 0, numFrames - 1); + last_update = ImGui::GetTime(); + } - ImGui::EndMenu(); + if(texture) + ImGui::Image((ImTextureID)texture, ImGuiUtils::GetScaledSize(ImVec2(frameWidth, frameHeight))); } - ImGui::EndMenuBar(); + + ImGui::End(); } + - if (spr) + if (igfd::ImGuiFileDialog::Instance()->FileDialog("SprView - Open")) { - auto [x1, y1] = ImGui::GetWindowContentRegionMin(); - auto [x2, y2] = ImGui::GetWindowContentRegionMax(); - - if (playing && ImGui::GetTime() > last_update + 1 / framerate) + // action if OK + if (igfd::ImGuiFileDialog::Instance()->IsOk == true) { - if(loop) - cur_frame = ++cur_frame % numFrames; - else - cur_frame = std::min(cur_frame + 1, numFrames - 1); - - last_update = ImGui::GetTime(); + std::string filePathName = igfd::ImGuiFileDialog::Instance()->GetFilepathName(); + std::string filePath = igfd::ImGuiFileDialog::Instance()->GetCurrentPath(); + // action + OpenFile(filePathName); } - - if(texture) - ImGui::Image((ImTextureID)texture, ImGuiUtils::GetScaledSize(ImVec2(frameWidth, frameHeight))); + // close + igfd::ImGuiFileDialog::Instance()->CloseDialog("SprView - Open"); } - - ImGui::End(); } - +}; - if (igfd::ImGuiFileDialog::Instance()->FileDialog("SprView - Open")) +std::unique_ptr g_SprView; + +void ImGui_SprView_Init() +{ + g_SprView = std::make_unique(); + g_SprView->Init(); +} + +void ImGui_SprView_OnGUI(void) +{ + g_SprView->OnGUI(); +} + +void ImGui_SprView::Con_SprView_f() +{ + g_SprView->enabled = true; + + if (Cmd_Argc() >= 2) { - // action if OK - if (igfd::ImGuiFileDialog::Instance()->IsOk == true) - { - std::string filePathName = igfd::ImGuiFileDialog::Instance()->GetFilepathName(); - std::string filePath = igfd::ImGuiFileDialog::Instance()->GetCurrentPath(); - // action - OpenFile(filePathName); - } - // close - igfd::ImGuiFileDialog::Instance()->CloseDialog("SprView - Open"); + g_SprView->OpenFile(Cmd_Argv(1)); } -} +} \ No newline at end of file diff --git a/engine/server/sv_frame.c b/engine/server/sv_frame.c index 71230b82b..a4db5ef6c 100644 --- a/engine/server/sv_frame.c +++ b/engine/server/sv_frame.c @@ -24,9 +24,6 @@ typedef struct entity_state_t entities[MAX_VISIBLE_PACKET]; } sv_ents_t; -static byte *clientpvs; // FatPVS -static byte *clientphs; // FatPHS - int c_fullsend; // just a debug counter /* @@ -65,6 +62,9 @@ static void SV_AddEntitiesToPacket( edict_t *pViewEnt, edict_t *pClient, client_ entity_state_t *state; int e, player; + static byte* clientpvs; // FatPVS + static byte* clientphs; // FatPHS + // during an error shutdown message we may need to transmit // the shutdown message after the server has shutdown, so // specifically check for it