mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-06-18 21:28:02 +00:00
Compare commits
1 Commits
6af4b8cf0c
...
dcaedc1d25
Author | SHA1 | Date | |
---|---|---|---|
![]() |
dcaedc1d25 |
@ -95,12 +95,16 @@ protected:
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
ClientModeHL1Normal::ClientModeHL1Normal() = default;
|
ClientModeHL1Normal::ClientModeHL1Normal()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: If you don't know what a destructor is by now, you are probably going to get fired
|
// Purpose: If you don't know what a destructor is by now, you are probably going to get fired
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
ClientModeHL1Normal::~ClientModeHL1Normal() = default;
|
ClientModeHL1Normal::~ClientModeHL1Normal()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void ClientModeHL1Normal::InitViewport()
|
void ClientModeHL1Normal::InitViewport()
|
||||||
{
|
{
|
||||||
|
@ -88,8 +88,8 @@ enum
|
|||||||
|
|
||||||
// Attack distance constants
|
// Attack distance constants
|
||||||
#define BIG_ATTACKDIST 170
|
#define BIG_ATTACKDIST 170
|
||||||
#define BIG_MORTARDIST 100
|
#define BIG_MORTARDIST 800
|
||||||
#define BIG_MAXCHILDREN 8 // Max # of live headcrab children
|
#define BIG_MAXCHILDREN 6 // Max # of live headcrab children
|
||||||
|
|
||||||
|
|
||||||
#define bits_MEMORY_CHILDPAIR (bits_MEMORY_CUSTOM1)
|
#define bits_MEMORY_CHILDPAIR (bits_MEMORY_CUSTOM1)
|
||||||
|
@ -2557,14 +2557,7 @@ AI_BEGIN_CUSTOM_NPC( monster_human_grunt, CNPC_HGrunt )
|
|||||||
|
|
||||||
AI_END_CUSTOM_NPC()
|
AI_END_CUSTOM_NPC()
|
||||||
|
|
||||||
// Nothing , just shit
|
|
||||||
/* void MortarSpray(const Vector& position, const Vector& direction, int spriteModel, int count)
|
|
||||||
{
|
|
||||||
CPVSFilter filter(position);
|
|
||||||
|
|
||||||
te->SpriteSpray(filter, 0.0, &position, &direction, spriteModel, 200, 80, count);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
// DEAD HGRUNT PROP
|
// DEAD HGRUNT PROP
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
//=============================================================================//
|
//=============================================================================//
|
||||||
|
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "convar.h"
|
|
||||||
#include "iconvar.h"
|
|
||||||
#include "hl1mp_basecombatweapon_shared.h"
|
#include "hl1mp_basecombatweapon_shared.h"
|
||||||
|
|
||||||
#ifdef CLIENT_DLL
|
#ifdef CLIENT_DLL
|
||||||
@ -18,8 +16,6 @@
|
|||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "soundent.h"
|
#include "soundent.h"
|
||||||
#endif
|
#endif
|
||||||
#include "decals.h"
|
|
||||||
#include "hl1_basecombatweapon_shared.h"
|
|
||||||
|
|
||||||
#include "gamerules.h"
|
#include "gamerules.h"
|
||||||
#include "ammodef.h"
|
#include "ammodef.h"
|
||||||
@ -27,34 +23,9 @@
|
|||||||
#include "in_buttons.h"
|
#include "in_buttons.h"
|
||||||
|
|
||||||
#include "vstdlib/random.h"
|
#include "vstdlib/random.h"
|
||||||
//For CrowbarVolume function
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
extern ConVar sk_plr_dmg_crowbar;
|
extern ConVar sk_plr_dmg_crowbar;
|
||||||
|
|
||||||
//new conVars for crowbar
|
|
||||||
//Crowbar Sounds
|
|
||||||
ConVar hl1_crowbar_sound("hl1_crowbar_sound", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_concrete("hl1_crowbar_concrete", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_metal("hl1_crowbar_metal", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_dirt("hl1_crowbar_dirt", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_vent("hl1_crowbar_vent", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_grate("hl1_crowbar_grate", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_tile("hl1_crowbar_tile", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_wood("hl1_crowbar_wood", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_glass("hl1_crowbar_glass", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_computer("hl1_crowbar_computer", "1", FCVAR_NONE, NULL);
|
|
||||||
|
|
||||||
ConVar hl1_crowbar_concrete_vol("hl1_crowbar_concrete_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_metal_vol("hl1_crowbar_metal_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_dirt_vol("hl1_crowbar_dirt_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_vent_vol("hl1_crowbar_vent_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_grate_vol("hl1_crowbar_grate_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_tile_vol("hl1_crowbar_tile_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_wood_vol("hl1_crowbar_wood_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_glass_vol("hl1_crowbar_glass_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
ConVar hl1_crowbar_computer_vol("hl1_crowbar_computer_vol", "1", FCVAR_NONE, NULL);
|
|
||||||
|
|
||||||
#define CROWBAR_RANGE 64.0f
|
#define CROWBAR_RANGE 64.0f
|
||||||
#define CROWBAR_REFIRE_MISS 0.5f
|
#define CROWBAR_REFIRE_MISS 0.5f
|
||||||
#define CROWBAR_REFIRE_HIT 0.25f
|
#define CROWBAR_REFIRE_HIT 0.25f
|
||||||
@ -64,69 +35,9 @@ ConVar hl1_crowbar_computer_vol("hl1_crowbar_computer_vol", "1", FCVAR_NONE, NUL
|
|||||||
#define CWeaponCrowbar C_WeaponCrowbar
|
#define CWeaponCrowbar C_WeaponCrowbar
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
struct TextureVolume
|
|
||||||
{
|
|
||||||
char type;
|
|
||||||
ConVar* enabledVar;
|
|
||||||
ConVar* volumeVar;
|
|
||||||
};
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// CWeaponCrowbar
|
// CWeaponCrowbar
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Define texture types and their associated ConVars
|
|
||||||
TextureVolume textureVolumes[] = {
|
|
||||||
{CHAR_TEX_CONCRETE, &hl1_crowbar_concrete, &hl1_crowbar_concrete_vol},
|
|
||||||
{CHAR_TEX_METAL, &hl1_crowbar_metal, &hl1_crowbar_metal_vol},
|
|
||||||
{CHAR_TEX_DIRT, &hl1_crowbar_dirt, &hl1_crowbar_dirt_vol},
|
|
||||||
{CHAR_TEX_VENT, &hl1_crowbar_vent, &hl1_crowbar_vent_vol},
|
|
||||||
{CHAR_TEX_GRATE, &hl1_crowbar_grate, &hl1_crowbar_grate_vol},
|
|
||||||
{CHAR_TEX_TILE, &hl1_crowbar_tile, &hl1_crowbar_tile_vol},
|
|
||||||
{CHAR_TEX_WOOD, &hl1_crowbar_wood, &hl1_crowbar_wood_vol},
|
|
||||||
{CHAR_TEX_GLASS, &hl1_crowbar_glass, &hl1_crowbar_glass_vol},
|
|
||||||
{CHAR_TEX_COMPUTER, &hl1_crowbar_computer, &hl1_crowbar_computer_vol}
|
|
||||||
};
|
|
||||||
|
|
||||||
float GetCrowbarVolume(const trace_t &ptr)
|
|
||||||
{
|
|
||||||
if (!hl1_crowbar_sound.GetBool())
|
|
||||||
return 0.0f;
|
|
||||||
|
|
||||||
float fvol = 0.0;
|
|
||||||
// Assume we determine the texture type based on entity properties or surface data
|
|
||||||
char mType = 0;
|
|
||||||
|
|
||||||
if (ptr.surface.name)
|
|
||||||
{
|
|
||||||
// Check the surface name for certain substrings to classify texture types
|
|
||||||
if (strstr(ptr.surface.name, "concrete")) mType = CHAR_TEX_CONCRETE;
|
|
||||||
else if (strstr(ptr.surface.name, "metal")) mType = CHAR_TEX_METAL;
|
|
||||||
else if (strstr(ptr.surface.name, "dirt")) mType = CHAR_TEX_DIRT;
|
|
||||||
else if (strstr(ptr.surface.name, "vent")) mType = CHAR_TEX_VENT;
|
|
||||||
else if (strstr(ptr.surface.name, "grate")) mType = CHAR_TEX_GRATE;
|
|
||||||
else if (strstr(ptr.surface.name, "tile")) mType = CHAR_TEX_TILE;
|
|
||||||
else if (strstr(ptr.surface.name, "wood")) mType = CHAR_TEX_WOOD;
|
|
||||||
else if (strstr(ptr.surface.name, "glass")) mType = CHAR_TEX_GLASS;
|
|
||||||
else if (strstr(ptr.surface.name, "computer")) mType = CHAR_TEX_COMPUTER;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& tv : textureVolumes)
|
|
||||||
{
|
|
||||||
if (mType == tv.type && tv.enabledVar->GetBool())
|
|
||||||
{
|
|
||||||
fvol = tv.volumeVar->GetFloat() / 10;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CBaseEntity* pEntity = ptr.m_pEnt;
|
|
||||||
if (pEntity && FClassnameIs(pEntity, "func_breakable"))
|
|
||||||
{
|
|
||||||
fvol /= 2.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return fvol;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CWeaponCrowbar : public CBaseHL1MPCombatWeapon
|
class CWeaponCrowbar : public CBaseHL1MPCombatWeapon
|
||||||
{
|
{
|
||||||
@ -238,7 +149,7 @@ void CWeaponCrowbar::ItemPostFrame( void )
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void CWeaponCrowbar::PrimaryAttack()
|
void CWeaponCrowbar::PrimaryAttack()
|
||||||
{
|
{
|
||||||
this->Swing();
|
Swing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -295,18 +206,14 @@ void CWeaponCrowbar::ImpactSound( CBaseEntity *pHitEntity )
|
|||||||
bIsWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
|
bIsWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
trace_t Trace;
|
|
||||||
memset(&Trace, 0, sizeof(trace_t));
|
|
||||||
Trace.m_pEnt = pHitEntity;
|
|
||||||
|
|
||||||
float m_SoundTexture = GetCrowbarVolume(Trace);
|
|
||||||
if( bIsWorld )
|
if( bIsWorld )
|
||||||
{
|
{
|
||||||
WeaponSound(MELEE_HIT_WORLD, m_SoundTexture);
|
WeaponSound( MELEE_HIT_WORLD );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WeaponSound(MELEE_HIT, m_SoundTexture);
|
WeaponSound( MELEE_HIT );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ void CWeapon357::PrimaryAttack( void )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
WeaponSound( EMPTY );
|
WeaponSound( EMPTY );
|
||||||
m_flNextPrimaryAttack = 0.1;
|
m_flNextPrimaryAttack = 0.15;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -859,7 +859,7 @@ void CGameRules::ClientSettingsChanged( CBasePlayer *pPlayer )
|
|||||||
if ( pszFov )
|
if ( pszFov )
|
||||||
{
|
{
|
||||||
int iFov = atoi(pszFov);
|
int iFov = atoi(pszFov);
|
||||||
iFov = clamp( iFov, 75, 150 );
|
iFov = clamp( iFov, 75, 110 );
|
||||||
pPlayer->SetDefaultFOV( iFov );
|
pPlayer->SetDefaultFOV( iFov );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,9 @@ COptionsSubAudio::COptionsSubAudio(vgui::Panel *parent) : PropertyPage(parent, N
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Destructor
|
// Purpose: Destructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
COptionsSubAudio::~COptionsSubAudio() = default;
|
COptionsSubAudio::~COptionsSubAudio()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Reloads data
|
// Purpose: Reloads data
|
||||||
|
@ -51,8 +51,7 @@ protected:
|
|||||||
void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label);
|
void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Get from OptionsSubTouchSettings.cpp
|
CCvarToggleCheckButton *m_pReverseTouchCheckBox;
|
||||||
/* CCvarToggleCheckButton *m_pReverseTouchCheckBox;
|
|
||||||
CCvarToggleCheckButton *m_pTouchFilterCheckBox;
|
CCvarToggleCheckButton *m_pTouchFilterCheckBox;
|
||||||
CCvarToggleCheckButton *m_pTouchRawCheckBox;
|
CCvarToggleCheckButton *m_pTouchRawCheckBox;
|
||||||
CCvarToggleCheckButton *m_pTouchAccelerationCheckBox;
|
CCvarToggleCheckButton *m_pTouchAccelerationCheckBox;
|
||||||
@ -74,7 +73,7 @@ private:
|
|||||||
CCvarSlider *m_pTouchPitchSensitivitySlider;
|
CCvarSlider *m_pTouchPitchSensitivitySlider;
|
||||||
vgui::Label *m_pTouchPitchSensitivityPreLabel;
|
vgui::Label *m_pTouchPitchSensitivityPreLabel;
|
||||||
vgui::TextEntry *m_pTouchYawSensitivityLabel;
|
vgui::TextEntry *m_pTouchYawSensitivityLabel;
|
||||||
vgui::TextEntry *m_pTouchPitchSensitivityLabel; */
|
vgui::TextEntry *m_pTouchPitchSensitivityLabel;
|
||||||
vgui::TextEntry *m_aspectRatioLabel;
|
vgui::TextEntry *m_aspectRatioLabel;
|
||||||
CCvarSlider *m_pEnableModificationsCheckBox;
|
CCvarSlider *m_pEnableModificationsCheckBox;
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
//=============================================================================//
|
//=============================================================================//
|
||||||
#include "OptionsSubMouse.h"
|
#include "OptionsSubMouse.h"
|
||||||
// #include "CommandCheckButton.h"
|
// #include "CommandCheckButton.h"
|
||||||
//#include "KeyToggleCheckButton.h" (Not used direcly)
|
#include "KeyToggleCheckButton.h"
|
||||||
#include "CvarNegateCheckButton.h"
|
#include "CvarNegateCheckButton.h"
|
||||||
#include "CvarToggleCheckButton.h"
|
#include "CvarToggleCheckButton.h"
|
||||||
#include "cvarslider.h"
|
#include "cvarslider.h"
|
||||||
|
@ -3612,7 +3612,7 @@ bool CDynamicMeshDX8::HasEnoughRoom( int nVertexCount, int nIndexCount ) const
|
|||||||
if ( g_pShaderDeviceDx8->IsDeactivated() )
|
if ( g_pShaderDeviceDx8->IsDeactivated() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Assert( m_pVertexBuffer != NULL );
|
Assert( m_pVertexBuffer != NULL );
|
||||||
|
|
||||||
// We need space in both the vertex and index buffer
|
// We need space in both the vertex and index buffer
|
||||||
return m_pVertexBuffer->HasEnoughRoom( nVertexCount ) &&
|
return m_pVertexBuffer->HasEnoughRoom( nVertexCount ) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user