mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-03-12 13:31:33 +00:00
Do not use client weapons.
This commit is contained in:
parent
f54e7b037b
commit
e3ec6cc19f
@ -26,7 +26,7 @@ project (CLDLL)
|
|||||||
set (CLDLL_LIBRARY client)
|
set (CLDLL_LIBRARY client)
|
||||||
|
|
||||||
|
|
||||||
add_definitions(-DCLIENT_WEAPONS -DCLIENT_DLL)
|
add_definitions(-DCLIENT_DLL)
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
add_compile_options(-fno-exceptions) # GCC/Clang flag
|
add_compile_options(-fno-exceptions) # GCC/Clang flag
|
||||||
@ -51,22 +51,6 @@ set (CLDLL_SOURCES
|
|||||||
noffice/pain.cpp
|
noffice/pain.cpp
|
||||||
noffice/cinematic.cpp
|
noffice/cinematic.cpp
|
||||||
noffice/deathvision.cpp
|
noffice/deathvision.cpp
|
||||||
../dlls/noffice/torch.cpp
|
|
||||||
../dlls/noffice/holster.cpp
|
|
||||||
# ../dlls/crossbow.cpp
|
|
||||||
../dlls/crowbar.cpp
|
|
||||||
# ../dlls/egon.cpp
|
|
||||||
# ../dlls/gauss.cpp
|
|
||||||
# ../dlls/handgrenade.cpp
|
|
||||||
# ../dlls/hornetgun.cpp
|
|
||||||
../dlls/mp5.cpp
|
|
||||||
# ../dlls/python.cpp
|
|
||||||
../dlls/rpg.cpp
|
|
||||||
# ../dlls/satchel.cpp
|
|
||||||
../dlls/shotgun.cpp
|
|
||||||
# ../dlls/squeakgrenade.cpp
|
|
||||||
../dlls/tripmine.cpp
|
|
||||||
../dlls/glock.cpp
|
|
||||||
ev_hldm.cpp
|
ev_hldm.cpp
|
||||||
hl/hl_baseentity.cpp
|
hl/hl_baseentity.cpp
|
||||||
hl/hl_events.cpp
|
hl/hl_events.cpp
|
||||||
|
@ -53,12 +53,6 @@ int g_irunninggausspred = 0;
|
|||||||
vec3_t previousorigin;
|
vec3_t previousorigin;
|
||||||
|
|
||||||
// HLDM Weapon placeholder entities.
|
// HLDM Weapon placeholder entities.
|
||||||
CHolster g_Holster;
|
|
||||||
CTorch g_Torch;
|
|
||||||
CGlock g_Glock;
|
|
||||||
CCrowbar g_Crowbar;
|
|
||||||
CMP5 g_Mp5;
|
|
||||||
CShotgun g_Shotgun;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
======================
|
======================
|
||||||
@ -592,14 +586,6 @@ void HUD_InitClientWeapons( void )
|
|||||||
|
|
||||||
// Allocate a slot for the local player
|
// Allocate a slot for the local player
|
||||||
HUD_PrepEntity( &player, NULL );
|
HUD_PrepEntity( &player, NULL );
|
||||||
|
|
||||||
// Allocate slot(s) for each weapon that we are going to be predicting
|
|
||||||
HUD_PrepEntity( &g_Holster, &player );
|
|
||||||
HUD_PrepEntity( &g_Torch, &player );
|
|
||||||
HUD_PrepEntity( &g_Glock, &player );
|
|
||||||
HUD_PrepEntity( &g_Crowbar, &player );
|
|
||||||
HUD_PrepEntity( &g_Mp5, &player );
|
|
||||||
HUD_PrepEntity( &g_Shotgun, &player );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -659,30 +645,6 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
|
|||||||
// Get current clock
|
// Get current clock
|
||||||
gpGlobals->time = time;
|
gpGlobals->time = time;
|
||||||
|
|
||||||
// Fill in data based on selected weapon
|
|
||||||
// FIXME, make this a method in each weapon? where you pass in an entity_state_t *?
|
|
||||||
switch( from->client.m_iId )
|
|
||||||
{
|
|
||||||
case WEAPON_HOLSTER:
|
|
||||||
pWeapon = &g_Holster;
|
|
||||||
break;
|
|
||||||
case WEAPON_TORCH:
|
|
||||||
pWeapon = &g_Torch;
|
|
||||||
break;
|
|
||||||
case WEAPON_CROWBAR:
|
|
||||||
pWeapon = &g_Crowbar;
|
|
||||||
break;
|
|
||||||
case WEAPON_GLOCK:
|
|
||||||
pWeapon = &g_Glock;
|
|
||||||
break;
|
|
||||||
case WEAPON_MP5:
|
|
||||||
pWeapon = &g_Mp5;
|
|
||||||
break;
|
|
||||||
case WEAPON_SHOTGUN:
|
|
||||||
pWeapon = &g_Shotgun;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store pointer to our destination entity_state_t so we can get our origin, etc. from it
|
// Store pointer to our destination entity_state_t so we can get our origin, etc. from it
|
||||||
// for setting up events on the client
|
// for setting up events on the client
|
||||||
g_finalstate = to;
|
g_finalstate = to;
|
||||||
|
@ -25,8 +25,6 @@ project (SVDLL)
|
|||||||
|
|
||||||
set (SVDLL_LIBRARY server)
|
set (SVDLL_LIBRARY server)
|
||||||
|
|
||||||
add_definitions(-DCLIENT_WEAPONS)
|
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
add_compile_options(-fno-exceptions) # GCC/Clang flag
|
add_compile_options(-fno-exceptions) # GCC/Clang flag
|
||||||
add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag
|
add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag
|
||||||
|
@ -217,7 +217,7 @@ int CCrowbar::Swing( int fFirst )
|
|||||||
if( fFirst )
|
if( fFirst )
|
||||||
{
|
{
|
||||||
// miss
|
// miss
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5 ;
|
||||||
// player "shoot" animation
|
// player "shoot" animation
|
||||||
m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
|
m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
|
||||||
}
|
}
|
||||||
@ -320,7 +320,7 @@ int CCrowbar::Swing( int fFirst )
|
|||||||
SetThink( &CCrowbar::Smack );
|
SetThink( &CCrowbar::Smack );
|
||||||
pev->nextthink = UTIL_WeaponTimeBase() + 0.2;
|
pev->nextthink = UTIL_WeaponTimeBase() + 0.2;
|
||||||
#endif
|
#endif
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5;
|
||||||
}
|
}
|
||||||
return fDidHit;
|
return fDidHit;
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ void CCrowbar::WeaponIdle( void )
|
|||||||
|
|
||||||
m_flReleaseThrow = 0;
|
m_flReleaseThrow = 0;
|
||||||
m_flStartThrow = 0;
|
m_flStartThrow = 0;
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5;
|
||||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5;
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ void CGlock::GlockFire( float flSpread, float flCycleTime, BOOL fUseAutoAim )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
PlayEmptySound();
|
PlayEmptySound();
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 0.2 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -139,14 +139,14 @@ void CMP5::PrimaryAttack()
|
|||||||
if( m_pPlayer->pev->waterlevel == 3 )
|
if( m_pPlayer->pev->waterlevel == 3 )
|
||||||
{
|
{
|
||||||
PlayEmptySound();
|
PlayEmptySound();
|
||||||
m_flNextPrimaryAttack = 0.15;
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_iClip <= 0 )
|
if( m_iClip <= 0 )
|
||||||
{
|
{
|
||||||
PlayEmptySound();
|
PlayEmptySound();
|
||||||
m_flNextPrimaryAttack = 0.15;
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ void CMP5::PrimaryAttack()
|
|||||||
// HEV suit - indicate out of ammo condition
|
// HEV suit - indicate out of ammo condition
|
||||||
m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 );
|
m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 );
|
||||||
|
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 0.1 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1;
|
||||||
|
|
||||||
if( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() )
|
if( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() )
|
||||||
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1;
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1;
|
||||||
|
@ -183,7 +183,7 @@ void CTorch::PrimaryAttack()
|
|||||||
|
|
||||||
PLAYBACK_EVENT_FULL(flags, m_pPlayer->edict(), m_usTorch, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, m_fIsOn, 0);
|
PLAYBACK_EVENT_FULL(flags, m_pPlayer->edict(), m_usTorch, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, m_fIsOn, 0);
|
||||||
|
|
||||||
m_flNextPrimaryAttack = m_flNextSecondaryAttack = GetNextAttackDelay(0.2);
|
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2;
|
||||||
|
|
||||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15);
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15);
|
||||||
|
|
||||||
@ -326,4 +326,4 @@ void CTorch::UpdateSpot(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ void CShotgun::PrimaryAttack()
|
|||||||
if( m_pPlayer->pev->waterlevel == 3 )
|
if( m_pPlayer->pev->waterlevel == 3 )
|
||||||
{
|
{
|
||||||
PlayEmptySound();
|
PlayEmptySound();
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 0.15 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ void CShotgun::PrimaryAttack()
|
|||||||
|
|
||||||
m_flPumpTime = gpGlobals->time + 0.5;
|
m_flPumpTime = gpGlobals->time + 0.5;
|
||||||
|
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 0.75 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.75;
|
||||||
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75;
|
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75;
|
||||||
if( m_iClip != 0 )
|
if( m_iClip != 0 )
|
||||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0;
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0;
|
||||||
@ -216,7 +216,7 @@ void CShotgun::Reload( void )
|
|||||||
m_fInSpecialReload = 1;
|
m_fInSpecialReload = 1;
|
||||||
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6;
|
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6;
|
||||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6;
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6;
|
||||||
m_flNextPrimaryAttack = GetNextAttackDelay( 1.0 );
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.0;
|
||||||
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0;
|
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user