From 68483bd0f681b8252c9cfeeb85878f321a3716e5 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 15:37:43 +0300 Subject: [PATCH 01/17] game: fix linux soundscapes (ValveSoftware/source-sdk-2013#448) --- game/server/soundscape_system.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/server/soundscape_system.cpp b/game/server/soundscape_system.cpp index 29b29402..360193c0 100644 --- a/game/server/soundscape_system.cpp +++ b/game/server/soundscape_system.cpp @@ -62,7 +62,7 @@ void CSoundscapeSystem::AddSoundscapeFile( const char *filename ) MEM_ALLOC_CREDIT(); // Open the soundscape data file, and abort if we can't KeyValues *pKeyValuesData = new KeyValues( filename ); - if ( filesystem->LoadKeyValues( *pKeyValuesData, IFileSystem::TYPE_SOUNDSCAPE, filename, "GAME" ) ) + if ( pKeyValuesData->LoadFromFile( filesystem, filename, "GAME" ) ) { // parse out all of the top level sections and save their names KeyValues *pKeys = pKeyValuesData; @@ -137,7 +137,7 @@ bool CSoundscapeSystem::Init() } KeyValues *manifest = new KeyValues( SOUNDSCAPE_MANIFEST_FILE ); - if ( filesystem->LoadKeyValues( *manifest, IFileSystem::TYPE_SOUNDSCAPE, SOUNDSCAPE_MANIFEST_FILE, "GAME" ) ) + if( manifest->LoadFromFile( filesystem, SOUNDSCAPE_MANIFEST_FILE, "GAME" ) ) { for ( KeyValues *sub = manifest->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() ) { From 047b3e315004c450bb1582b65a279e01ebf1e095 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 15:43:17 +0300 Subject: [PATCH 02/17] game: fix hl2mp slam (ValveSoftware/source-sdk-2013#532) --- game/shared/hl2mp/weapon_slam.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game/shared/hl2mp/weapon_slam.cpp b/game/shared/hl2mp/weapon_slam.cpp index bcdec40c..9cbc2574 100644 --- a/game/shared/hl2mp/weapon_slam.cpp +++ b/game/shared/hl2mp/weapon_slam.cpp @@ -303,9 +303,9 @@ bool CWeapon_SLAM::AnyUndetonatedCharges(void) void CWeapon_SLAM::StartSatchelDetonate() { - if ( GetActivity() != ACT_SLAM_DETONATOR_IDLE && GetActivity() != ACT_SLAM_THROW_IDLE ) + if ( GetActivity() != ACT_SLAM_DETONATOR_IDLE && GetActivity() != ACT_SLAM_THROW_IDLE && !m_bDetonatorArmed ) return; - + // ----------------------------------------- // Play detonate animation // ----------------------------------------- @@ -313,7 +313,7 @@ void CWeapon_SLAM::StartSatchelDetonate() { SendWeaponAnim(ACT_SLAM_DETONATOR_DETONATE); } - else if (m_tSlamState == SLAM_SATCHEL_ATTACH) + else if (m_tSlamState == SLAM_SATCHEL_ATTACH || m_tSlamState == SLAM_TRIPMINE_READY) { SendWeaponAnim(ACT_SLAM_STICKWALL_DETONATE); } From 81c354ee0dc72392214f64343e7abdad0e6c5fcf Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 15:47:40 +0300 Subject: [PATCH 03/17] game: use gpGlobals->interval_per_tick instead of DEFAULT_TICK_INTERVAL (ValveSoftware/source-sdk-2013#515) --- game/server/physics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game/server/physics.cpp b/game/server/physics.cpp index 2adc5587..8d2c54d4 100644 --- a/game/server/physics.cpp +++ b/game/server/physics.cpp @@ -242,8 +242,8 @@ void CPhysicsHook::LevelInitPreEntity() physenv->EnableConstraintNotify( true ); // callback when an object gets deleted that is attached to a constraint physenv->SetObjectEventHandler( &g_Collisions ); - - physenv->SetSimulationTimestep( DEFAULT_TICK_INTERVAL ); // 15 ms per tick + + physenv->SetSimulationTimestep( gpGlobals->interval_per_tick ); // 15 ms per tick // HL Game gravity, not real-world gravity physenv->SetGravity( Vector( 0, 0, -GetCurrentGravity() ) ); g_PhysAverageSimTime = 0; @@ -1606,7 +1606,7 @@ CON_COMMAND( physics_budget, "Times the cost of each active object" ) float totalTime = 0.f; g_Collisions.BufferTouchEvents( true ); float full = engine->Time(); - physenv->Simulate( DEFAULT_TICK_INTERVAL ); + physenv->Simulate( gpGlobals->interval_per_tick ); full = engine->Time() - full; float lastTime = full; @@ -1623,7 +1623,7 @@ CON_COMMAND( physics_budget, "Times the cost of each active object" ) PhysForceEntityToSleep( ents[j], ents[j]->VPhysicsGetObject() ); } float start = engine->Time(); - physenv->Simulate( DEFAULT_TICK_INTERVAL ); + physenv->Simulate( gpGlobals->interval_per_tick ); float end = engine->Time(); float elapsed = end - start; From 2e969d389042ef1b2f66259860aa7a74bbffae44 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 16:42:47 +0300 Subject: [PATCH 04/17] game: fixes some player's origin displacements for fire events, impulses commands etc... (ValveSoftware/source-sdk-2013#442) --- game/client/prediction.cpp | 4 ++-- game/server/player_command.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/game/client/prediction.cpp b/game/client/prediction.cpp index 6646f8f9..508fc5de 100644 --- a/game/client/prediction.cpp +++ b/game/client/prediction.cpp @@ -903,10 +903,10 @@ void CPrediction::RunCommand( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper pVehicle->ProcessMovement( player, g_pMoveData ); } - FinishMove( player, ucmd, g_pMoveData ); - RunPostThink( player ); + FinishMove( player, ucmd, g_pMoveData ); + g_pGameMovement->FinishTrackPredictionErrors( player ); FinishCommand( player ); diff --git a/game/server/player_command.cpp b/game/server/player_command.cpp index b607bbab..0b82f719 100644 --- a/game/server/player_command.cpp +++ b/game/server/player_command.cpp @@ -417,6 +417,11 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper player->pl.v_angle = ucmd->viewangles + player->pl.anglechange; } + // Let server invoke any needed impact functions + VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" ); + moveHelper->ProcessImpacts(); + VPROF_SCOPE_END(); + // Call standard client pre-think RunPreThink( player ); @@ -442,11 +447,6 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper // Copy output FinishMove( player, ucmd, g_pMoveData ); - // Let server invoke any needed impact functions - VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" ); - moveHelper->ProcessImpacts(); - VPROF_SCOPE_END(); - RunPostThink( player ); g_pGameMovement->FinishTrackPredictionErrors( player ); From 21c54015a23348c79739a883feecbba725211d75 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 16:49:14 +0300 Subject: [PATCH 05/17] game: fixed infinite recursion by using incorrect key on value conversation. (ValveSoftware/source-sdk-2013#380) --- game/shared/baseentity_shared.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/shared/baseentity_shared.cpp b/game/shared/baseentity_shared.cpp index a702ba94..3dfa5147 100644 --- a/game/shared/baseentity_shared.cpp +++ b/game/shared/baseentity_shared.cpp @@ -408,7 +408,7 @@ bool CBaseEntity::KeyValue( const char *szKeyName, const char *szValue ) } // Do this so inherited classes looking for 'angles' don't have to bother with 'angle' - return KeyValue( szKeyName, szBuf ); + return KeyValue( "angles", szBuf ); } // NOTE: Have to do these separate because they set two values instead of one From 148035ce3151d377807dd396e1d70df277c9de6c Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 16:56:29 +0300 Subject: [PATCH 06/17] game: fixed npc_manhack not notifying npc_template_maker/npc_maker when thrown and destroyed with gravity gun. (ValveSoftware/source-sdk-2013#362) --- game/server/hl2/npc_manhack.cpp | 6 +++++- game/server/hl2/npc_manhack.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/game/server/hl2/npc_manhack.cpp b/game/server/hl2/npc_manhack.cpp index feef84f8..77cd6337 100644 --- a/game/server/hl2/npc_manhack.cpp +++ b/game/server/hl2/npc_manhack.cpp @@ -3007,6 +3007,8 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r } else { + m_pPrevOwner.Set( GetOwnerEntity() ); + // Suppress collisions between the manhack and the player; we're currently bumping // almost certainly because it's not purely a physics object. SetOwnerEntity( pPhysGunUser ); @@ -3022,8 +3024,10 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r //----------------------------------------------------------------------------- void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason ) { + SetOwnerEntity( m_pPrevOwner.Get() ); + // Stop suppressing collisions between the manhack and the player - SetOwnerEntity( NULL ); + m_pPrevOwner.Set( NULL ); m_bHeld = false; diff --git a/game/server/hl2/npc_manhack.h b/game/server/hl2/npc_manhack.h index 17a3cedb..761ccd4a 100644 --- a/game/server/hl2/npc_manhack.h +++ b/game/server/hl2/npc_manhack.h @@ -254,6 +254,7 @@ private: CSprite *m_pLightGlow; CHandle m_hSmokeTrail; + CHandle m_pPrevOwner; int m_iPanel1; int m_iPanel2; From a0d8a59d58233477abf11f01027ef71334251cd2 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 16:58:40 +0300 Subject: [PATCH 07/17] game: touch customization and small update --- game/client/touch.cpp | 28 +++++++++++++++++++++++++--- game/client/touch.h | 1 + 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/game/client/touch.cpp b/game/client/touch.cpp index c695b975..a6df7dcb 100644 --- a/game/client/touch.cpp +++ b/game/client/touch.cpp @@ -17,6 +17,8 @@ extern ConVar cl_forwardspeed; extern ConVar cl_upspeed; extern ConVar default_fov; +extern IMatSystemSurface *g_pMatSystemSurface; + #ifdef ANDROID #define TOUCH_DEFAULT "1" #else @@ -232,6 +234,15 @@ CON_COMMAND( touch_loaddefaults, "generate config from defaults" ) { gTouch.ResetToDefaults(); } + +CON_COMMAND( touch_setgridcolor, "change grid color" ) +{ + if( args.ArgC() >= 5 ) + gTouch.gridcolor = rgba_t( Q_atoi( args[1] ), Q_atoi( args[2] ), Q_atoi( args[3] ), Q_atoi( args[4] ) ); + else + Msg( "Usage: touch_setgridcolor \n" ); +} + /* CON_COMMAND( touch_roundall, "round all buttons coordinates to grid" ) { @@ -294,6 +305,7 @@ void CTouchControls::ResetToDefaults() { rgba_t color(255, 255, 255, 155); char buf[MAX_PATH]; + gridcolor = rgba_t(255, 0, 0, 50); RemoveButtons(); @@ -351,6 +363,7 @@ void CTouchControls::Init() mouse_events = 0; move_start_x = move_start_y = 0.0f; m_flPreviousYaw = m_flPreviousPitch = 0.f; + gridcolor = rgba_t(255, 0, 0, 50); showtexture = hidetexture = resettexture = closetexture = joytexture = 0; configchanged = false; @@ -463,7 +476,7 @@ void CTouchControls::Paint( ) if( state == state_edit ) { - vgui::surface()->DrawSetColor(255, 0, 0, 200); + vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a*3); // 255, 0, 0, 200 <- default here float x,y; for( x = 0.0f; x < 1.0f; x += GRID_X ) @@ -471,6 +484,7 @@ void CTouchControls::Paint( ) for( y = 0.0f; y < 1.0f; y += GRID_Y ) vgui::surface()->DrawLine( 0, screen_h*y, screen_w, screen_h*y ); + } CUtlLinkedList::iterator it; @@ -487,7 +501,13 @@ void CTouchControls::Paint( ) if( state == state_edit && !(btn->flags & TOUCH_FL_NOEDIT) ) { - vgui::surface()->DrawSetColor(255, 0, 0, 50); + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h, 255, 255, 255, 255, "N: %s", btn->name ); // name + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+10, 255, 255, 255, 255, "T: %s", btn->texturefile ); // texture + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+20, 255, 255, 255, 255, "C: %s", btn->command ); // command + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+30, 255, 255, 255, 255, "F: %i", btn->flags ); // flags + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+40, 255, 255, 255, 255, "RGBA: %d %d %d %d", btn->color.r, btn->color.g, btn->color.b, btn->color.a );// color + + vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a); // 255, 0, 0, 50 <- default here vgui::surface()->DrawFilledRect( btn->x1*screen_w, btn->y1*screen_h, btn->x2*screen_w, btn->y2*screen_h ); } } @@ -795,7 +815,7 @@ void CTouchControls::EnableTouchEdit(bool enable) resize_finger = move_finger = look_finger = wheel_finger = -1; move_button = NULL; configchanged = true; - AddButton( "close_edit", "vgui/touch/back", "touch_disableedit", 0.010000, 0.837778, 0.080000, 0.980000, rgba_t(255,255,255,255), 0, 1.f, TOUCH_FL_NOEDIT ); + AddButton( "close_edit", "vgui/touch/back", "touch_disableedit", 0.020000, 0.800000, 0.100000, 0.977778, rgba_t(255,255,255,255), 0, 1.f, TOUCH_FL_NOEDIT ); } else { @@ -848,6 +868,8 @@ void CTouchControls::WriteConfig() filesystem->FPrintf( f, "\n// grid settings\n" ); filesystem->FPrintf( f, "touch_grid_count \"%d\"\n", touch_grid_count.GetInt() ); filesystem->FPrintf( f, "touch_grid_enable \"%d\"\n", touch_grid_enable.GetInt() ); + + filesystem->FPrintf( f, "touch_setgridcolor \"%d\" \"%d\" \"%d\" \"%d\"\n", gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a ); /* filesystem->FPrintf( f, "\n// global overstroke (width, r, g, b, a)\n" ); filesystem->FPrintf( f, "touch_set_stroke %d %d %d %d %d\n", touch.swidth, touch.scolor[0], touch.scolor[1], touch.scolor[2], touch.scolor[3] ); diff --git a/game/client/touch.h b/game/client/touch.h index 80cee87f..aa7a4e82 100644 --- a/game/client/touch.h +++ b/game/client/touch.h @@ -193,6 +193,7 @@ public: float screen_h, screen_w; float forward, side, movecount; float yaw, pitch; + rgba_t gridcolor; private: bool initialized = false; From 387d15521ae7a0b6b9b9f7bed03ef467428d0e29 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 17:24:18 +0300 Subject: [PATCH 08/17] game: fix typo in logical expression (ValveSoftware/source-sdk-2013#502) --- game/server/ai_behavior_assault.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/server/ai_behavior_assault.cpp b/game/server/ai_behavior_assault.cpp index e02627cc..d57ec618 100644 --- a/game/server/ai_behavior_assault.cpp +++ b/game/server/ai_behavior_assault.cpp @@ -1257,7 +1257,7 @@ int CAI_AssaultBehavior::TranslateSchedule( int scheduleType ) break; case SCHED_HOLD_RALLY_POINT: - if( HasCondition(COND_NO_PRIMARY_AMMO) | HasCondition(COND_LOW_PRIMARY_AMMO) ) + if( HasCondition(COND_NO_PRIMARY_AMMO) || HasCondition(COND_LOW_PRIMARY_AMMO) ) { return SCHED_RELOAD; } From 42b528dec355fc70972d9358fd3aefa4928aaf2b Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 17:39:41 +0300 Subject: [PATCH 09/17] game: fixed a format string vulnerability in CDebugOverlay::Paint (ValveSoftware/source-sdk-2013#372) --- game/client/vgui_debugoverlaypanel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game/client/vgui_debugoverlaypanel.cpp b/game/client/vgui_debugoverlaypanel.cpp index c3734147..db530617 100644 --- a/game/client/vgui_debugoverlaypanel.cpp +++ b/game/client/vgui_debugoverlaypanel.cpp @@ -125,20 +125,20 @@ void CDebugOverlay::Paint() if (pCurrText->bUseOrigin) { - if (!debugoverlay->ScreenPosition( pCurrText->origin, screenPos )) + if (!debugoverlay->ScreenPosition( pCurrText->origin, screenPos )) { float xPos = screenPos[0]; float yPos = screenPos[1]+ (pCurrText->lineOffset*13); // Line spacing; - g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, pCurrText->text ); + g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, "%s", pCurrText->text ); } } else { - if (!debugoverlay->ScreenPosition( pCurrText->flXPos,pCurrText->flYPos, screenPos )) - { + if (!debugoverlay->ScreenPosition( pCurrText->flXPos,pCurrText->flYPos, screenPos )) + { float xPos = screenPos[0]; float yPos = screenPos[1]+ (pCurrText->lineOffset*13); // Line spacing; - g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, pCurrText->text ); + g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, "%s", pCurrText->text ); } } } From 4838d9ee3f72adece5fda99708bfa3ca6cc8a70c Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 17:50:12 +0300 Subject: [PATCH 10/17] game: changed delay parameter for ent_fire (ValveSoftware/source-sdk-2013#300) --- game/server/baseentity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/server/baseentity.cpp b/game/server/baseentity.cpp index 7593ce88..4ca53810 100644 --- a/game/server/baseentity.cpp +++ b/game/server/baseentity.cpp @@ -5336,7 +5336,7 @@ public: { const char *target = "", *action = "Use"; variant_t value; - int delay = 0; + float delay = 0; target = STRING( AllocPooledString(command.Arg( 1 ) ) ); From 69b377495bb9ef8dcd9ea7bb7a35e080a0ee217f Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 17:53:54 +0300 Subject: [PATCH 11/17] game: update hud_flashlight.cpp (::yoba_Ukraine::) (ValveSoftware/source-sdk-2013#275) --- game/client/hl2/hud_flashlight.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/client/hl2/hud_flashlight.cpp b/game/client/hl2/hud_flashlight.cpp index 7c63f7a7..dd83bac8 100644 --- a/game/client/hl2/hud_flashlight.cpp +++ b/game/client/hl2/hud_flashlight.cpp @@ -135,7 +135,7 @@ void CHudFlashlight::Paint() surface()->DrawSetTextPos( m_IconX, m_IconY ); surface()->DrawUnicodeChar( pState ); - // Don't draw the progress bar is we're fully charged + // Don't draw the progress bar if we're fully charged if ( bIsOn == false && chunkCount == enabledChunks ) return; From 27339449c067a00d9997a2d71a3c8f7ab4d070cb Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 18:17:52 +0300 Subject: [PATCH 12/17] game: rpg missle fixes (hrgve/hl2dm-bugfix@36de43ebc1efe7fa6b29613b85c942e86b39b940) --- game/shared/hl2mp/weapon_rpg.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/game/shared/hl2mp/weapon_rpg.cpp b/game/shared/hl2mp/weapon_rpg.cpp index 34ca3398..3d91f4e9 100644 --- a/game/shared/hl2mp/weapon_rpg.cpp +++ b/game/shared/hl2mp/weapon_rpg.cpp @@ -359,6 +359,11 @@ void CMissile::ShotDown( void ) //----------------------------------------------------------------------------- void CMissile::DoExplosion( void ) { + //Fix GetAbsOrigin().z+1 in gamerules.cpp:349 + Vector origin = GetAbsOrigin(); + origin.z -= 1; + SetAbsOrigin( origin ); + // Explode ExplosionCreate( GetAbsOrigin(), GetAbsAngles(), GetOwnerEntity(), GetDamage(), GetDamage() * 2, SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this); @@ -452,7 +457,7 @@ void CMissile::IgniteThink( void ) { SetMoveType( MOVETYPE_FLY ); SetModel("models/weapons/w_missile.mdl"); - UTIL_SetSize( this, vec3_origin, vec3_origin ); + //UTIL_SetSize( this, vec3_origin, vec3_origin ); //This cause weird no damage dealing on stairs RemoveSolidFlags( FSOLID_NOT_SOLID ); //TODO: Play opening sound From 8a366537e787671ae33edcfa7712ac28043cc033 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 18:28:28 +0300 Subject: [PATCH 13/17] game: fix death icon in hl2mp (hrgve/hl2dm-bugfix@6f7337d3f2cac50af45848129fd7b7a8a547066b) --- game/shared/hl2mp/hl2mp_gamerules.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/game/shared/hl2mp/hl2mp_gamerules.cpp b/game/shared/hl2mp/hl2mp_gamerules.cpp index 604e409c..b59ddf2e 100644 --- a/game/shared/hl2mp/hl2mp_gamerules.cpp +++ b/game/shared/hl2mp/hl2mp_gamerules.cpp @@ -727,6 +727,11 @@ void CHL2MPRules::DeathNotice( CBasePlayer *pVictim, const CTakeDamageInfo &info killer_weapon_name = "physics"; } + if ( strstr( killer_weapon_name, "physbox" ) ) + { + killer_weapon_name = "physics"; + } + if ( strcmp( killer_weapon_name, "prop_combine_ball" ) == 0 ) { killer_weapon_name = "combine_ball"; @@ -1277,4 +1282,4 @@ const char *CHL2MPRules::GetChatFormat( bool bTeamOnly, CBasePlayer *pPlayer ) return pszFormat; } -#endif \ No newline at end of file +#endif From 9a03faec585848d706560fbd59f1262cff719a54 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 18:38:47 +0300 Subject: [PATCH 14/17] game: fix satchel/tripmine damage and damage radius cvars (hrgve/hl2dm-bugfix@d2aa89fc0fbe732396be37cd65144dd3a9a943c3) --- game/server/hl2mp/grenade_satchel.cpp | 13 ++++++------- game/server/hl2mp/grenade_tripmine.cpp | 20 +++++++++----------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/game/server/hl2mp/grenade_satchel.cpp b/game/server/hl2mp/grenade_satchel.cpp index 9b304ad8..29983712 100644 --- a/game/server/hl2mp/grenade_satchel.cpp +++ b/game/server/hl2mp/grenade_satchel.cpp @@ -19,9 +19,9 @@ #define SLAM_SPRITE "sprites/redglow1.vmt" -ConVar sk_plr_dmg_satchel ( "sk_plr_dmg_satchel","0"); -ConVar sk_npc_dmg_satchel ( "sk_npc_dmg_satchel","0"); -ConVar sk_satchel_radius ( "sk_satchel_radius","0"); +ConVar sk_plr_dmg_satchel ( "sk_plr_dmg_satchel","150"); // commented lines in hl2/skill.cfg +ConVar sk_npc_dmg_satchel ( "sk_npc_dmg_satchel","75"); +ConVar sk_satchel_radius ( "sk_satchel_radius","150"); BEGIN_DATADESC( CSatchelCharge ) @@ -73,15 +73,14 @@ void CSatchelCharge::Spawn( void ) SetThink( &CSatchelCharge::SatchelThink ); SetNextThink( gpGlobals->curtime + 0.1f ); - m_flDamage = sk_plr_dmg_satchel.GetFloat(); - m_DmgRadius = sk_satchel_radius.GetFloat(); m_takedamage = DAMAGE_YES; m_iHealth = 1; SetGravity( UTIL_ScaleForGravity( 560 ) ); // slightly lower gravity SetFriction( 1.0 ); SetSequence( 1 ); - SetDamage( 150 ); + SetDamage( sk_plr_dmg_satchel.GetFloat() ); + SetDamageRadius( sk_satchel_radius.GetFloat() ); m_bIsAttached = false; m_bInAir = true; @@ -118,7 +117,7 @@ void CSatchelCharge::CreateEffects( void ) //----------------------------------------------------------------------------- void CSatchelCharge::InputExplode( inputdata_t &inputdata ) { - ExplosionCreate( GetAbsOrigin() + Vector( 0, 0, 16 ), GetAbsAngles(), GetThrower(), GetDamage(), 200, + ExplosionCreate( GetAbsOrigin() + Vector( 0, 0, 16 ), GetAbsAngles(), GetThrower(), GetDamage(), GetDamageRadius(), SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this); UTIL_Remove( this ); diff --git a/game/server/hl2mp/grenade_tripmine.cpp b/game/server/hl2mp/grenade_tripmine.cpp index e14a929d..5c67503d 100644 --- a/game/server/hl2mp/grenade_tripmine.cpp +++ b/game/server/hl2mp/grenade_tripmine.cpp @@ -18,9 +18,9 @@ extern const char* g_pModelNameLaser; -ConVar sk_plr_dmg_tripmine ( "sk_plr_dmg_tripmine","0"); -ConVar sk_npc_dmg_tripmine ( "sk_npc_dmg_tripmine","0"); -ConVar sk_tripmine_radius ( "sk_tripmine_radius","0"); +ConVar sk_plr_dmg_tripmine ( "sk_plr_dmg_tripmine","150"); // commented values in hl2/skill.cfg +ConVar sk_npc_dmg_tripmine ( "sk_npc_dmg_tripmine","125"); +ConVar sk_tripmine_radius ( "sk_tripmine_radius","200"); LINK_ENTITY_TO_CLASS( npc_tripmine, CTripmineGrenade ); @@ -59,22 +59,19 @@ void CTripmineGrenade::Spawn( void ) SetSolid( SOLID_BBOX ); SetModel( "models/Weapons/w_slam.mdl" ); - IPhysicsObject *pObject = VPhysicsInitNormal( SOLID_BBOX, GetSolidFlags() | FSOLID_TRIGGER, true ); + IPhysicsObject *pObject = VPhysicsInitNormal( SOLID_BBOX, GetSolidFlags() | FSOLID_TRIGGER, true ); pObject->EnableMotion( false ); SetCollisionGroup( COLLISION_GROUP_WEAPON ); SetCycle( 0.0f ); m_nBody = 3; - m_flDamage = sk_plr_dmg_tripmine.GetFloat(); - m_DmgRadius = sk_tripmine_radius.GetFloat(); - ResetSequenceInfo( ); m_flPlaybackRate = 0; - + UTIL_SetSize(this, Vector( -4, -4, -2), Vector(4, 4, 2)); m_flPowerUp = gpGlobals->curtime + 2.0; - + SetThink( &CTripmineGrenade::PowerupThink ); SetNextThink( gpGlobals->curtime + 0.2 ); @@ -83,7 +80,8 @@ void CTripmineGrenade::Spawn( void ) m_iHealth = 1; EmitSound( "TripmineGrenade.Place" ); - SetDamage ( 200 ); + SetDamage( sk_plr_dmg_tripmine.GetFloat() ); + SetDamageRadius( sk_tripmine_radius.GetFloat() ); // Tripmine sits at 90 on wall so rotate back to get m_vecDir QAngle angles = GetAbsAngles(); @@ -268,7 +266,7 @@ void CTripmineGrenade::DelayDeathThink( void ) UTIL_TraceLine ( GetAbsOrigin() + m_vecDir * 8, GetAbsOrigin() - m_vecDir * 64, MASK_SOLID, this, COLLISION_GROUP_NONE, & tr); UTIL_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START ); - ExplosionCreate( GetAbsOrigin() + m_vecDir * 8, GetAbsAngles(), m_hOwner, GetDamage(), 200, + ExplosionCreate( GetAbsOrigin() + m_vecDir * 8, GetAbsAngles(), m_hOwner, GetDamage(), GetDamageRadius(), SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this); UTIL_Remove( this ); From c0472cccbf5545077350d7b245e23ccae4bc3cff Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Wed, 17 Aug 2022 02:45:02 +0300 Subject: [PATCH 15/17] game: fix camera glitch with FOV 110 --- game/client/view.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/game/client/view.h b/game/client/view.h index 7c41593a..f03dc4c0 100644 --- a/game/client/view.h +++ b/game/client/view.h @@ -24,11 +24,7 @@ class VPlane; // near and far Z it uses to render the world. -#ifndef HL1_CLIENT_DLL -#define VIEW_NEARZ 7 -#else #define VIEW_NEARZ 3 -#endif //#define VIEW_FARZ 28400 From 53ed9e3bd8d32c5a2ac57b1f9ff33b4899b8c1fd Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Fri, 19 Aug 2022 23:00:06 +0300 Subject: [PATCH 16/17] Revert "game: fixes some player's origin displacements for fire events, impulses commands etc... (ValveSoftware/source-sdk-2013#442)" This reverts commit 2e969d389042ef1b2f66259860aa7a74bbffae44. --- game/client/prediction.cpp | 4 ++-- game/server/player_command.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/game/client/prediction.cpp b/game/client/prediction.cpp index 508fc5de..6646f8f9 100644 --- a/game/client/prediction.cpp +++ b/game/client/prediction.cpp @@ -903,10 +903,10 @@ void CPrediction::RunCommand( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper pVehicle->ProcessMovement( player, g_pMoveData ); } - RunPostThink( player ); - FinishMove( player, ucmd, g_pMoveData ); + RunPostThink( player ); + g_pGameMovement->FinishTrackPredictionErrors( player ); FinishCommand( player ); diff --git a/game/server/player_command.cpp b/game/server/player_command.cpp index 0b82f719..b607bbab 100644 --- a/game/server/player_command.cpp +++ b/game/server/player_command.cpp @@ -417,11 +417,6 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper player->pl.v_angle = ucmd->viewangles + player->pl.anglechange; } - // Let server invoke any needed impact functions - VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" ); - moveHelper->ProcessImpacts(); - VPROF_SCOPE_END(); - // Call standard client pre-think RunPreThink( player ); @@ -447,6 +442,11 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper // Copy output FinishMove( player, ucmd, g_pMoveData ); + // Let server invoke any needed impact functions + VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" ); + moveHelper->ProcessImpacts(); + VPROF_SCOPE_END(); + RunPostThink( player ); g_pGameMovement->FinishTrackPredictionErrors( player ); From c41148b9dd7cb94ca3340eff3a70a48e311d8c82 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Fri, 19 Aug 2022 23:43:31 +0300 Subject: [PATCH 17/17] game: disable text on buttons by default --- game/client/touch.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/game/client/touch.cpp b/game/client/touch.cpp index a6df7dcb..83bb6b40 100644 --- a/game/client/touch.cpp +++ b/game/client/touch.cpp @@ -41,6 +41,8 @@ ConVar touch_grid_count( "touch_grid_count", "50", FCVAR_ARCHIVE, "touch grid co ConVar touch_grid_enable( "touch_grid_enable", "1", FCVAR_ARCHIVE, "enable touch grid" ); ConVar touch_precise_amount( "touch_precise_amount", "0.5", FCVAR_ARCHIVE, "sensitivity multiplier for precise-look" ); +ConVar touch_button_info( "touch_button_info", "0", FCVAR_ARCHIVE ); + #define boundmax( num, high ) ( (num) < (high) ? (num) : (high) ) #define boundmin( num, low ) ( (num) >= (low) ? (num) : (low) ) #define bound( low, num, high ) ( boundmin( boundmax(num, high), low )) @@ -143,7 +145,7 @@ CON_COMMAND( touch_addbutton, "add native touch button" ) Msg( "Usage: touch_addbutton [ [ r g b a ] ]\n" ); } -CON_COMMAND( touch_removebutton, "add native touch button" ) +CON_COMMAND( touch_removebutton, "remove native touch button" ) { if( args.ArgC() > 1 ) gTouch.RemoveButton( args[1] ); @@ -151,7 +153,7 @@ CON_COMMAND( touch_removebutton, "add native touch button" ) Msg( "Usage: touch_removebutton \n" ); } -CON_COMMAND( touch_settexture, "add native touch button" ) +CON_COMMAND( touch_settexture, "set button texture" ) { if( args.ArgC() >= 3 ) { @@ -501,11 +503,14 @@ void CTouchControls::Paint( ) if( state == state_edit && !(btn->flags & TOUCH_FL_NOEDIT) ) { - g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h, 255, 255, 255, 255, "N: %s", btn->name ); // name - g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+10, 255, 255, 255, 255, "T: %s", btn->texturefile ); // texture - g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+20, 255, 255, 255, 255, "C: %s", btn->command ); // command - g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+30, 255, 255, 255, 255, "F: %i", btn->flags ); // flags - g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+40, 255, 255, 255, 255, "RGBA: %d %d %d %d", btn->color.r, btn->color.g, btn->color.b, btn->color.a );// color + if( touch_button_info.GetInt() ) + { + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h, 255, 255, 255, 255, "N: %s", btn->name ); // name + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+10, 255, 255, 255, 255, "T: %s", btn->texturefile ); // texture + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+20, 255, 255, 255, 255, "C: %s", btn->command ); // command + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+30, 255, 255, 255, 255, "F: %i", btn->flags ); // flags + g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+40, 255, 255, 255, 255, "RGBA: %d %d %d %d", btn->color.r, btn->color.g, btn->color.b, btn->color.a );// color + } vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a); // 255, 0, 0, 50 <- default here vgui::surface()->DrawFilledRect( btn->x1*screen_w, btn->y1*screen_h, btn->x2*screen_w, btn->y2*screen_h ); @@ -870,6 +875,7 @@ void CTouchControls::WriteConfig() filesystem->FPrintf( f, "touch_grid_enable \"%d\"\n", touch_grid_enable.GetInt() ); filesystem->FPrintf( f, "touch_setgridcolor \"%d\" \"%d\" \"%d\" \"%d\"\n", gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a ); + filesystem->FPrintf( f, "touch_button_info \"%d\"\n", touch_button_info.GetInt() ); /* filesystem->FPrintf( f, "\n// global overstroke (width, r, g, b, a)\n" ); filesystem->FPrintf( f, "touch_set_stroke %d %d %d %d %d\n", touch.swidth, touch.scolor[0], touch.scolor[1], touch.scolor[2], touch.scolor[3] );