Browse Source

Merge pull request #112 from SanyaSho/fixes

Fixes (x2)
pull/114/head
nillerusr 2 years ago committed by GitHub
parent
commit
1f0ae521d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      game/client/hl2/hud_flashlight.cpp
  2. 38
      game/client/touch.cpp
  3. 1
      game/client/touch.h
  4. 10
      game/client/vgui_debugoverlaypanel.cpp
  5. 4
      game/client/view.h
  6. 2
      game/server/ai_behavior_assault.cpp
  7. 2
      game/server/baseentity.cpp
  8. 6
      game/server/hl2/npc_manhack.cpp
  9. 1
      game/server/hl2/npc_manhack.h
  10. 13
      game/server/hl2mp/grenade_satchel.cpp
  11. 20
      game/server/hl2mp/grenade_tripmine.cpp
  12. 8
      game/server/physics.cpp
  13. 4
      game/server/soundscape_system.cpp
  14. 2
      game/shared/baseentity_shared.cpp
  15. 7
      game/shared/hl2mp/hl2mp_gamerules.cpp
  16. 7
      game/shared/hl2mp/weapon_rpg.cpp
  17. 6
      game/shared/hl2mp/weapon_slam.cpp

2
game/client/hl2/hud_flashlight.cpp

@ -135,7 +135,7 @@ void CHudFlashlight::Paint()
surface()->DrawSetTextPos( m_IconX, m_IconY ); surface()->DrawSetTextPos( m_IconX, m_IconY );
surface()->DrawUnicodeChar( pState ); 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 ) if ( bIsOn == false && chunkCount == enabledChunks )
return; return;

38
game/client/touch.cpp

@ -17,6 +17,8 @@ extern ConVar cl_forwardspeed;
extern ConVar cl_upspeed; extern ConVar cl_upspeed;
extern ConVar default_fov; extern ConVar default_fov;
extern IMatSystemSurface *g_pMatSystemSurface;
#ifdef ANDROID #ifdef ANDROID
#define TOUCH_DEFAULT "1" #define TOUCH_DEFAULT "1"
#else #else
@ -39,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_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_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 boundmax( num, high ) ( (num) < (high) ? (num) : (high) )
#define boundmin( num, low ) ( (num) >= (low) ? (num) : (low) ) #define boundmin( num, low ) ( (num) >= (low) ? (num) : (low) )
#define bound( low, num, high ) ( boundmin( boundmax(num, high), low )) #define bound( low, num, high ) ( boundmin( boundmax(num, high), low ))
@ -141,7 +145,7 @@ CON_COMMAND( touch_addbutton, "add native touch button" )
Msg( "Usage: touch_addbutton <name> <texture> <command> [<x1> <y1> <x2> <y2> [ r g b a ] ]\n" ); Msg( "Usage: touch_addbutton <name> <texture> <command> [<x1> <y1> <x2> <y2> [ 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 ) if( args.ArgC() > 1 )
gTouch.RemoveButton( args[1] ); gTouch.RemoveButton( args[1] );
@ -149,7 +153,7 @@ CON_COMMAND( touch_removebutton, "add native touch button" )
Msg( "Usage: touch_removebutton <name>\n" ); Msg( "Usage: touch_removebutton <name>\n" );
} }
CON_COMMAND( touch_settexture, "add native touch button" ) CON_COMMAND( touch_settexture, "set button texture" )
{ {
if( args.ArgC() >= 3 ) if( args.ArgC() >= 3 )
{ {
@ -232,6 +236,15 @@ CON_COMMAND( touch_loaddefaults, "generate config from defaults" )
{ {
gTouch.ResetToDefaults(); 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 <r> <g> <b> <a>\n" );
}
/* /*
CON_COMMAND( touch_roundall, "round all buttons coordinates to grid" ) CON_COMMAND( touch_roundall, "round all buttons coordinates to grid" )
{ {
@ -294,6 +307,7 @@ void CTouchControls::ResetToDefaults()
{ {
rgba_t color(255, 255, 255, 155); rgba_t color(255, 255, 255, 155);
char buf[MAX_PATH]; char buf[MAX_PATH];
gridcolor = rgba_t(255, 0, 0, 50);
RemoveButtons(); RemoveButtons();
@ -351,6 +365,7 @@ void CTouchControls::Init()
mouse_events = 0; mouse_events = 0;
move_start_x = move_start_y = 0.0f; move_start_x = move_start_y = 0.0f;
m_flPreviousYaw = m_flPreviousPitch = 0.f; m_flPreviousYaw = m_flPreviousPitch = 0.f;
gridcolor = rgba_t(255, 0, 0, 50);
showtexture = hidetexture = resettexture = closetexture = joytexture = 0; showtexture = hidetexture = resettexture = closetexture = joytexture = 0;
configchanged = false; configchanged = false;
@ -463,7 +478,7 @@ void CTouchControls::Paint( )
if( state == state_edit ) 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; float x,y;
for( x = 0.0f; x < 1.0f; x += GRID_X ) for( x = 0.0f; x < 1.0f; x += GRID_X )
@ -471,6 +486,7 @@ void CTouchControls::Paint( )
for( y = 0.0f; y < 1.0f; y += GRID_Y ) for( y = 0.0f; y < 1.0f; y += GRID_Y )
vgui::surface()->DrawLine( 0, screen_h*y, screen_w, screen_h*y ); vgui::surface()->DrawLine( 0, screen_h*y, screen_w, screen_h*y );
} }
CUtlLinkedList<CTouchButton*>::iterator it; CUtlLinkedList<CTouchButton*>::iterator it;
@ -487,7 +503,16 @@ void CTouchControls::Paint( )
if( state == state_edit && !(btn->flags & TOUCH_FL_NOEDIT) ) if( state == state_edit && !(btn->flags & TOUCH_FL_NOEDIT) )
{ {
vgui::surface()->DrawSetColor(255, 0, 0, 50); 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 ); vgui::surface()->DrawFilledRect( btn->x1*screen_w, btn->y1*screen_h, btn->x2*screen_w, btn->y2*screen_h );
} }
} }
@ -795,7 +820,7 @@ void CTouchControls::EnableTouchEdit(bool enable)
resize_finger = move_finger = look_finger = wheel_finger = -1; resize_finger = move_finger = look_finger = wheel_finger = -1;
move_button = NULL; move_button = NULL;
configchanged = true; 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 else
{ {
@ -848,6 +873,9 @@ void CTouchControls::WriteConfig()
filesystem->FPrintf( f, "\n// grid settings\n" ); filesystem->FPrintf( f, "\n// grid settings\n" );
filesystem->FPrintf( f, "touch_grid_count \"%d\"\n", touch_grid_count.GetInt() ); 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_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, "\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] ); 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] );

1
game/client/touch.h

@ -193,6 +193,7 @@ public:
float screen_h, screen_w; float screen_h, screen_w;
float forward, side, movecount; float forward, side, movecount;
float yaw, pitch; float yaw, pitch;
rgba_t gridcolor;
private: private:
bool initialized = false; bool initialized = false;

10
game/client/vgui_debugoverlaypanel.cpp

@ -125,20 +125,20 @@ void CDebugOverlay::Paint()
if (pCurrText->bUseOrigin) if (pCurrText->bUseOrigin)
{ {
if (!debugoverlay->ScreenPosition( pCurrText->origin, screenPos )) if (!debugoverlay->ScreenPosition( pCurrText->origin, screenPos ))
{ {
float xPos = screenPos[0]; float xPos = screenPos[0];
float yPos = screenPos[1]+ (pCurrText->lineOffset*13); // Line spacing; 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 else
{ {
if (!debugoverlay->ScreenPosition( pCurrText->flXPos,pCurrText->flYPos, screenPos )) if (!debugoverlay->ScreenPosition( pCurrText->flXPos,pCurrText->flYPos, screenPos ))
{ {
float xPos = screenPos[0]; float xPos = screenPos[0];
float yPos = screenPos[1]+ (pCurrText->lineOffset*13); // Line spacing; 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 );
} }
} }
} }

4
game/client/view.h

@ -24,11 +24,7 @@ class VPlane;
// near and far Z it uses to render the world. // near and far Z it uses to render the world.
#ifndef HL1_CLIENT_DLL
#define VIEW_NEARZ 7
#else
#define VIEW_NEARZ 3 #define VIEW_NEARZ 3
#endif
//#define VIEW_FARZ 28400 //#define VIEW_FARZ 28400

2
game/server/ai_behavior_assault.cpp

@ -1257,7 +1257,7 @@ int CAI_AssaultBehavior::TranslateSchedule( int scheduleType )
break; break;
case SCHED_HOLD_RALLY_POINT: 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; return SCHED_RELOAD;
} }

2
game/server/baseentity.cpp

@ -5336,7 +5336,7 @@ public:
{ {
const char *target = "", *action = "Use"; const char *target = "", *action = "Use";
variant_t value; variant_t value;
int delay = 0; float delay = 0;
target = STRING( AllocPooledString(command.Arg( 1 ) ) ); target = STRING( AllocPooledString(command.Arg( 1 ) ) );

6
game/server/hl2/npc_manhack.cpp

@ -3007,6 +3007,8 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
} }
else else
{ {
m_pPrevOwner.Set( GetOwnerEntity() );
// Suppress collisions between the manhack and the player; we're currently bumping // Suppress collisions between the manhack and the player; we're currently bumping
// almost certainly because it's not purely a physics object. // almost certainly because it's not purely a physics object.
SetOwnerEntity( pPhysGunUser ); SetOwnerEntity( pPhysGunUser );
@ -3022,8 +3024,10 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason ) void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason )
{ {
SetOwnerEntity( m_pPrevOwner.Get() );
// Stop suppressing collisions between the manhack and the player // Stop suppressing collisions between the manhack and the player
SetOwnerEntity( NULL ); m_pPrevOwner.Set( NULL );
m_bHeld = false; m_bHeld = false;

1
game/server/hl2/npc_manhack.h

@ -254,6 +254,7 @@ private:
CSprite *m_pLightGlow; CSprite *m_pLightGlow;
CHandle<SmokeTrail> m_hSmokeTrail; CHandle<SmokeTrail> m_hSmokeTrail;
CHandle<CBaseEntity> m_pPrevOwner;
int m_iPanel1; int m_iPanel1;
int m_iPanel2; int m_iPanel2;

13
game/server/hl2mp/grenade_satchel.cpp

@ -19,9 +19,9 @@
#define SLAM_SPRITE "sprites/redglow1.vmt" #define SLAM_SPRITE "sprites/redglow1.vmt"
ConVar sk_plr_dmg_satchel ( "sk_plr_dmg_satchel","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","0"); ConVar sk_npc_dmg_satchel ( "sk_npc_dmg_satchel","75");
ConVar sk_satchel_radius ( "sk_satchel_radius","0"); ConVar sk_satchel_radius ( "sk_satchel_radius","150");
BEGIN_DATADESC( CSatchelCharge ) BEGIN_DATADESC( CSatchelCharge )
@ -73,15 +73,14 @@ void CSatchelCharge::Spawn( void )
SetThink( &CSatchelCharge::SatchelThink ); SetThink( &CSatchelCharge::SatchelThink );
SetNextThink( gpGlobals->curtime + 0.1f ); SetNextThink( gpGlobals->curtime + 0.1f );
m_flDamage = sk_plr_dmg_satchel.GetFloat();
m_DmgRadius = sk_satchel_radius.GetFloat();
m_takedamage = DAMAGE_YES; m_takedamage = DAMAGE_YES;
m_iHealth = 1; m_iHealth = 1;
SetGravity( UTIL_ScaleForGravity( 560 ) ); // slightly lower gravity SetGravity( UTIL_ScaleForGravity( 560 ) ); // slightly lower gravity
SetFriction( 1.0 ); SetFriction( 1.0 );
SetSequence( 1 ); SetSequence( 1 );
SetDamage( 150 ); SetDamage( sk_plr_dmg_satchel.GetFloat() );
SetDamageRadius( sk_satchel_radius.GetFloat() );
m_bIsAttached = false; m_bIsAttached = false;
m_bInAir = true; m_bInAir = true;
@ -118,7 +117,7 @@ void CSatchelCharge::CreateEffects( void )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CSatchelCharge::InputExplode( inputdata_t &inputdata ) 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); SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this);
UTIL_Remove( this ); UTIL_Remove( this );

20
game/server/hl2mp/grenade_tripmine.cpp

@ -18,9 +18,9 @@
extern const char* g_pModelNameLaser; extern const char* g_pModelNameLaser;
ConVar sk_plr_dmg_tripmine ( "sk_plr_dmg_tripmine","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","0"); ConVar sk_npc_dmg_tripmine ( "sk_npc_dmg_tripmine","125");
ConVar sk_tripmine_radius ( "sk_tripmine_radius","0"); ConVar sk_tripmine_radius ( "sk_tripmine_radius","200");
LINK_ENTITY_TO_CLASS( npc_tripmine, CTripmineGrenade ); LINK_ENTITY_TO_CLASS( npc_tripmine, CTripmineGrenade );
@ -59,22 +59,19 @@ void CTripmineGrenade::Spawn( void )
SetSolid( SOLID_BBOX ); SetSolid( SOLID_BBOX );
SetModel( "models/Weapons/w_slam.mdl" ); 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 ); pObject->EnableMotion( false );
SetCollisionGroup( COLLISION_GROUP_WEAPON ); SetCollisionGroup( COLLISION_GROUP_WEAPON );
SetCycle( 0.0f ); SetCycle( 0.0f );
m_nBody = 3; m_nBody = 3;
m_flDamage = sk_plr_dmg_tripmine.GetFloat();
m_DmgRadius = sk_tripmine_radius.GetFloat();
ResetSequenceInfo( ); ResetSequenceInfo( );
m_flPlaybackRate = 0; m_flPlaybackRate = 0;
UTIL_SetSize(this, Vector( -4, -4, -2), Vector(4, 4, 2)); UTIL_SetSize(this, Vector( -4, -4, -2), Vector(4, 4, 2));
m_flPowerUp = gpGlobals->curtime + 2.0; m_flPowerUp = gpGlobals->curtime + 2.0;
SetThink( &CTripmineGrenade::PowerupThink ); SetThink( &CTripmineGrenade::PowerupThink );
SetNextThink( gpGlobals->curtime + 0.2 ); SetNextThink( gpGlobals->curtime + 0.2 );
@ -83,7 +80,8 @@ void CTripmineGrenade::Spawn( void )
m_iHealth = 1; m_iHealth = 1;
EmitSound( "TripmineGrenade.Place" ); 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 // Tripmine sits at 90 on wall so rotate back to get m_vecDir
QAngle angles = GetAbsAngles(); 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_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 ); 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); SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this);
UTIL_Remove( this ); UTIL_Remove( this );

8
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->EnableConstraintNotify( true ); // callback when an object gets deleted that is attached to a constraint
physenv->SetObjectEventHandler( &g_Collisions ); 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 // HL Game gravity, not real-world gravity
physenv->SetGravity( Vector( 0, 0, -GetCurrentGravity() ) ); physenv->SetGravity( Vector( 0, 0, -GetCurrentGravity() ) );
g_PhysAverageSimTime = 0; g_PhysAverageSimTime = 0;
@ -1606,7 +1606,7 @@ CON_COMMAND( physics_budget, "Times the cost of each active object" )
float totalTime = 0.f; float totalTime = 0.f;
g_Collisions.BufferTouchEvents( true ); g_Collisions.BufferTouchEvents( true );
float full = engine->Time(); float full = engine->Time();
physenv->Simulate( DEFAULT_TICK_INTERVAL ); physenv->Simulate( gpGlobals->interval_per_tick );
full = engine->Time() - full; full = engine->Time() - full;
float lastTime = 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() ); PhysForceEntityToSleep( ents[j], ents[j]->VPhysicsGetObject() );
} }
float start = engine->Time(); float start = engine->Time();
physenv->Simulate( DEFAULT_TICK_INTERVAL ); physenv->Simulate( gpGlobals->interval_per_tick );
float end = engine->Time(); float end = engine->Time();
float elapsed = end - start; float elapsed = end - start;

4
game/server/soundscape_system.cpp

@ -62,7 +62,7 @@ void CSoundscapeSystem::AddSoundscapeFile( const char *filename )
MEM_ALLOC_CREDIT(); MEM_ALLOC_CREDIT();
// Open the soundscape data file, and abort if we can't // Open the soundscape data file, and abort if we can't
KeyValues *pKeyValuesData = new KeyValues( filename ); 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 // parse out all of the top level sections and save their names
KeyValues *pKeys = pKeyValuesData; KeyValues *pKeys = pKeyValuesData;
@ -137,7 +137,7 @@ bool CSoundscapeSystem::Init()
} }
KeyValues *manifest = new KeyValues( SOUNDSCAPE_MANIFEST_FILE ); 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() ) for ( KeyValues *sub = manifest->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() )
{ {

2
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' // 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 // NOTE: Have to do these separate because they set two values instead of one

7
game/shared/hl2mp/hl2mp_gamerules.cpp

@ -727,6 +727,11 @@ void CHL2MPRules::DeathNotice( CBasePlayer *pVictim, const CTakeDamageInfo &info
killer_weapon_name = "physics"; killer_weapon_name = "physics";
} }
if ( strstr( killer_weapon_name, "physbox" ) )
{
killer_weapon_name = "physics";
}
if ( strcmp( killer_weapon_name, "prop_combine_ball" ) == 0 ) if ( strcmp( killer_weapon_name, "prop_combine_ball" ) == 0 )
{ {
killer_weapon_name = "combine_ball"; killer_weapon_name = "combine_ball";
@ -1277,4 +1282,4 @@ const char *CHL2MPRules::GetChatFormat( bool bTeamOnly, CBasePlayer *pPlayer )
return pszFormat; return pszFormat;
} }
#endif #endif

7
game/shared/hl2mp/weapon_rpg.cpp

@ -359,6 +359,11 @@ void CMissile::ShotDown( void )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CMissile::DoExplosion( void ) void CMissile::DoExplosion( void )
{ {
//Fix GetAbsOrigin().z+1 in gamerules.cpp:349
Vector origin = GetAbsOrigin();
origin.z -= 1;
SetAbsOrigin( origin );
// Explode // Explode
ExplosionCreate( GetAbsOrigin(), GetAbsAngles(), GetOwnerEntity(), GetDamage(), GetDamage() * 2, ExplosionCreate( GetAbsOrigin(), GetAbsAngles(), GetOwnerEntity(), GetDamage(), GetDamage() * 2,
SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this); SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this);
@ -452,7 +457,7 @@ void CMissile::IgniteThink( void )
{ {
SetMoveType( MOVETYPE_FLY ); SetMoveType( MOVETYPE_FLY );
SetModel("models/weapons/w_missile.mdl"); 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 ); RemoveSolidFlags( FSOLID_NOT_SOLID );
//TODO: Play opening sound //TODO: Play opening sound

6
game/shared/hl2mp/weapon_slam.cpp

@ -303,9 +303,9 @@ bool CWeapon_SLAM::AnyUndetonatedCharges(void)
void CWeapon_SLAM::StartSatchelDetonate() 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; return;
// ----------------------------------------- // -----------------------------------------
// Play detonate animation // Play detonate animation
// ----------------------------------------- // -----------------------------------------
@ -313,7 +313,7 @@ void CWeapon_SLAM::StartSatchelDetonate()
{ {
SendWeaponAnim(ACT_SLAM_DETONATOR_DETONATE); 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); SendWeaponAnim(ACT_SLAM_STICKWALL_DETONATE);
} }

Loading…
Cancel
Save