mirror of https://github.com/FWGS/hlsdk-xash3d
Fixes
This commit is contained in:
parent
14b7acff68
commit
618e379ebf
|
@ -96,6 +96,8 @@ public:
|
|||
// Process movement of player
|
||||
virtual void StudioProcessGait( entity_state_t *pplayer );
|
||||
|
||||
virtual int ReturnDiguisedClass( int iPlayerIndex );
|
||||
|
||||
public:
|
||||
|
||||
// Client clock
|
||||
|
|
|
@ -532,7 +532,7 @@ void DLLEXPORT HUD_CreateEntities( void )
|
|||
Game_AddObjects();
|
||||
}
|
||||
|
||||
extern int g_bACSpinning[33];
|
||||
int g_bACSpinning[33];
|
||||
|
||||
/*
|
||||
=========================
|
||||
|
|
|
@ -61,10 +61,10 @@ struct eventnode_s
|
|||
};
|
||||
typedef eventnode_s eventnode_t;
|
||||
|
||||
pmtrace_t *gp_tr_decal[32];
|
||||
float g_flSpinDownTime[32];
|
||||
int g_bACSpinning[32];
|
||||
float g_flSpinUpTime[32];
|
||||
pmtrace_t *gp_tr_decal[33];
|
||||
extern float g_flSpinDownTime[33];
|
||||
extern int g_bACSpinning[33];
|
||||
extern float g_flSpinUpTime[33];
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
|
|
@ -6,40 +6,18 @@
|
|||
#include "nodes.h"
|
||||
#include "player.h"
|
||||
#include "gamerules.h"
|
||||
#include "tf_defs.h"
|
||||
|
||||
LINK_ENTITY_TO_CLASS( tf_weapon_axe, CTFAxe )
|
||||
|
||||
void CTFAxe::Spawn()
|
||||
{
|
||||
Precache();
|
||||
|
||||
m_iId = 5;
|
||||
m_iClip = -1;
|
||||
pev->solid = SOLID_TRIGGER;
|
||||
}
|
||||
|
||||
int CTFAxe::GetItemInfo( ItemInfo *p )
|
||||
{
|
||||
p->pszAmmo1 = 0;
|
||||
p->pszName = STRING( pev->classname );
|
||||
p->iMaxAmmo1 = -1;
|
||||
p->pszAmmo2 = 0;
|
||||
p->iMaxAmmo2 = -1;
|
||||
p->iSlot = 0;
|
||||
p->iPosition = 3;
|
||||
p->iFlags = 0;
|
||||
p->iMaxClip = -1;
|
||||
p->iId = 5;
|
||||
p->iWeight = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CTFAxe::Holster()
|
||||
{
|
||||
SendWeaponAnim(AXE_HOLSTER, 1);
|
||||
m_pPlayer->m_flNextAttack = 0.5;
|
||||
}
|
||||
|
||||
void CTFAxe::Precache()
|
||||
{
|
||||
PRECACHE_MODEL("models/v_umbrella.mdl");
|
||||
|
@ -53,43 +31,113 @@ void CTFAxe::Precache()
|
|||
PRECACHE_SOUND("weapons/cbar_hitbod2.wav");
|
||||
PRECACHE_SOUND("weapons/cbar_hitbod3.wav");
|
||||
PRECACHE_SOUND("weapons/cbar_miss1.wav");
|
||||
classid = 3;
|
||||
classid = PC_SOLDIER;
|
||||
m_usAxe = PRECACHE_EVENT(1, "events/wpn/tf_axe.sc");
|
||||
m_usAxeDecal = PRECACHE_EVENT(1, "events/wpn/tf_axedecal.sc");
|
||||
}
|
||||
|
||||
int CTFAxe::GetItemInfo( ItemInfo *p )
|
||||
{
|
||||
p->pszAmmo1 = 0;
|
||||
p->iMaxAmmo1 = -1;
|
||||
p->pszName = STRING( pev->classname );
|
||||
p->pszAmmo2 = 0;
|
||||
p->iMaxAmmo2 = -1;
|
||||
p->iMaxClip = -1;
|
||||
p->iSlot = 0;
|
||||
p->iPosition = 3;
|
||||
p->iFlags = 0;
|
||||
p->iId = WEAPON_AXE;
|
||||
p->iWeight = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CTFAxe::Holster()
|
||||
{
|
||||
m_pPlayer->m_flNextAttack = 0.5;
|
||||
SendWeaponAnim(AXE_HOLSTER, 1);
|
||||
}
|
||||
|
||||
BOOL CTFAxe::AxeHit(CBaseEntity *pTarget, Vector p_vecDir, TraceResult *ptr)
|
||||
{
|
||||
ClearMultiDamage();
|
||||
if(m_pPlayer->pev->playerclass != PC_SPY)
|
||||
{
|
||||
pTarget->TraceAttack(m_pPlayer->pev, 20, p_vecDir, ptr, 128);
|
||||
ApplyMultiDamage(m_pPlayer->pev, m_pPlayer->pev);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(pTarget->IsPlayer())
|
||||
{
|
||||
UTIL_MakeVectors(pTarget->pev->v_angle);
|
||||
UTIL_MakeVectors(m_pPlayer->pev->v_angle);
|
||||
if(gpGlobals->v_right.x * gpGlobals->v_forward.y - gpGlobals->v_right.y * gpGlobals->v_forward.x <= 0.0)
|
||||
{
|
||||
pTarget->TraceAttack(m_pPlayer->pev, 40, p_vecDir, ptr, 128);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_bHullHit)
|
||||
{
|
||||
pTarget->TraceAttack(m_pPlayer->pev, 120, p_vecDir, ptr, 128);
|
||||
}
|
||||
else
|
||||
{
|
||||
pTarget->TraceAttack(m_pPlayer->pev, 60, p_vecDir, ptr, 128);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pTarget->TraceAttack(m_pPlayer->pev, 20, p_vecDir, ptr, 128);
|
||||
ApplyMultiDamage(m_pPlayer->pev, m_pPlayer->pev);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ApplyMultiDamage(m_pPlayer->pev, m_pPlayer->pev);
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL CTFAxe::Deploy()
|
||||
{
|
||||
if(m_pPlayer->pev->playerclass == 11)
|
||||
if(m_pPlayer->pev->playerclass == PC_CIVILIAN)
|
||||
return DefaultDeploy( "models/v_umbrella.mdl", "models/p_umbrella.mdl", AXE_DRAW, "crowbar", 1 );
|
||||
else
|
||||
return DefaultDeploy( "models/v_tfc_crowbar.mdl", "models/p_crowbar.mdl", AXE_DRAW, "crowbar", 1 );
|
||||
}
|
||||
//Velaron: finish this?
|
||||
|
||||
void CTFAxe::PrimaryAttack()
|
||||
{
|
||||
vec3_t vecSrc, vecEnd;
|
||||
Vector vecSrc, vecEnd;
|
||||
TraceResult tr;
|
||||
|
||||
m_bHullHit = 0;
|
||||
UTIL_MakeVectors(m_pPlayer->pev->v_angle);
|
||||
vecSrc = m_pPlayer->GetGunPosition();
|
||||
vecEnd.x = gpGlobals->v_forward.x * 32.0 + vecSrc.x;
|
||||
vecEnd.y = gpGlobals->v_forward.y * 32.0 + vecSrc.y;
|
||||
vecEnd.z = gpGlobals->v_forward.z * 32.0 + vecSrc.z;
|
||||
vecEnd = gpGlobals->v_forward * 32.0f + vecSrc;
|
||||
UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(m_pPlayer->pev), &tr);
|
||||
PLAYBACK_EVENT_FULL(1, ENT(m_pPlayer->pev), m_usAxe, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0, 0, classid, 0, 0, 0);
|
||||
if ( tr.flFraction >= 1.0 )
|
||||
{
|
||||
m_bHullHit = 1;
|
||||
//m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.4;
|
||||
m_flNextPrimaryAttack = 1.0;
|
||||
m_flTimeWeaponIdle = 5;
|
||||
m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
|
||||
return;
|
||||
}
|
||||
m_flNextPrimaryAttack = 1.0;
|
||||
m_flTimeWeaponIdle = 5;
|
||||
m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
|
||||
m_flTimeWeaponIdle = 5;
|
||||
m_flNextPrimaryAttack = 1.0;
|
||||
|
||||
if(!tr.pHit)
|
||||
{
|
||||
m_pPlayer->m_iWeaponVolume = 128;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pPlayer->m_iWeaponVolume = 512;
|
||||
}
|
||||
}
|
||||
|
||||
LINK_ENTITY_TO_CLASS( tf_weapon_spanner, CTFSpanner )
|
||||
|
|
|
@ -73,7 +73,7 @@ void CTFGrenadeLauncher::Reload()
|
|||
{
|
||||
if ( m_pPlayer->ammo_rockets > 0 )
|
||||
{
|
||||
if ( m_iClip != 6 && m_flNextReload <= 0.0 && m_flNextPrimaryAttack <= 0.0 )
|
||||
if ( m_iClip != 6 && m_flNextPrimaryAttack <= 0.0 ) //&& m_flNextReload <= 0.0
|
||||
{
|
||||
if (m_fInSpecialReload)
|
||||
{
|
||||
|
|
|
@ -58,14 +58,14 @@ void CTFRpg::Precache()
|
|||
|
||||
void CTFRpg::Reload( void )
|
||||
{
|
||||
if ( m_pPlayer->ammo_rockets == 0 || m_iClip == 4 || m_flNextReload > 0.0 || m_flNextPrimaryAttack > 0.0)
|
||||
if ( m_pPlayer->ammo_rockets == 0 || m_iClip == 4 || m_flNextPrimaryAttack > 0.0) // || m_flNextReload > 0.0
|
||||
return;
|
||||
|
||||
if ( m_fInSpecialReload )
|
||||
{
|
||||
if ( m_fInSpecialReload == 1 )
|
||||
{
|
||||
if ( m_flTimeWeaponIdle <= gpGlobals->time )
|
||||
if ( m_flTimeWeaponIdle <= UTIL_WeaponTimeBase() )
|
||||
{
|
||||
m_fInSpecialReload = 2;
|
||||
SendWeaponAnim(TFCRPG_RELCYCLE, 1);
|
||||
|
@ -95,24 +95,26 @@ void CTFRpg::Reload( void )
|
|||
|
||||
void CTFRpg::WeaponIdle( void )
|
||||
{
|
||||
ResetEmptySound();
|
||||
if (m_flTimeWeaponIdle > 0.0)
|
||||
return;
|
||||
|
||||
if(m_iClip > 0)
|
||||
ResetEmptySound();
|
||||
if(m_flTimeWeaponIdle <= 0.0)
|
||||
{
|
||||
if(m_iClip)
|
||||
{
|
||||
if(!m_fInSpecialReload)
|
||||
{
|
||||
if (m_pPlayer->ammo_rockets > 0)
|
||||
if(m_pPlayer->ammo_rockets)
|
||||
{
|
||||
if(m_iClip == 0)
|
||||
m_flTimeWeaponIdle = 3.0;
|
||||
/*
|
||||
if(m_iClip < 1)
|
||||
SendWeaponAnim(TFCRPG_FIDGET2, 1);
|
||||
else
|
||||
SendWeaponAnim(TFCRPG_IDLE, 1);
|
||||
m_flTimeWeaponIdle = 3;
|
||||
SendWeaponAnim(TFCRPG_FIDGET, 1);
|
||||
*/
|
||||
}
|
||||
else
|
||||
m_flTimeWeaponIdle = 1;
|
||||
m_flTimeWeaponIdle = 1.0;
|
||||
return;
|
||||
}
|
||||
if(m_iClip == 4)
|
||||
|
@ -130,17 +132,18 @@ void CTFRpg::WeaponIdle( void )
|
|||
Reload();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_pPlayer->ammo_rockets > 0)
|
||||
if(m_pPlayer->ammo_rockets)
|
||||
{
|
||||
if(m_iClip == 0)
|
||||
m_flTimeWeaponIdle = 3.0;
|
||||
/*
|
||||
if(m_iClip < 1)
|
||||
SendWeaponAnim(TFCRPG_FIDGET2, 1);
|
||||
else
|
||||
SendWeaponAnim(TFCRPG_IDLE, 1);
|
||||
m_flTimeWeaponIdle = 3;
|
||||
SendWeaponAnim(TFCRPG_FIDGET, 1);
|
||||
*/
|
||||
}
|
||||
else
|
||||
m_flTimeWeaponIdle = 1;
|
||||
m_flTimeWeaponIdle = 1.0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -155,6 +158,7 @@ void CTFRpg::WeaponIdle( void )
|
|||
m_flTimeWeaponIdle = 1.5;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CTFRpg::Deploy()
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ void CTFShotgun::Reload( void )
|
|||
{
|
||||
if ( m_pPlayer->ammo_buckshot >= m_iShellsReloaded )
|
||||
{
|
||||
if ( m_iClip != m_iMaxClipSize && m_flNextReload <= 0.0 && m_flNextPrimaryAttack <= 0.0 )
|
||||
if ( m_iClip != m_iMaxClipSize && m_flNextPrimaryAttack <= 0.0 ) // && m_flNextReload <= 0.0
|
||||
{
|
||||
if (m_fInSpecialReload)
|
||||
{
|
||||
|
|
|
@ -463,8 +463,11 @@ public:
|
|||
int GetItemInfo(ItemInfo *p);
|
||||
BOOL CanHolster(void) {return 1;};
|
||||
void Holster(void);
|
||||
BOOL AxeHit(CBaseEntity *pTarget, Vector p_vecDir, TraceResult *ptr);
|
||||
BOOL Deploy(void);
|
||||
void PrimaryAttack(void);
|
||||
int iItemSlot( void ) {return 1;}
|
||||
int IsUseable( void ) {return 1;}
|
||||
int classid;
|
||||
BOOL m_bHullHit;
|
||||
unsigned short m_usAxe;
|
||||
|
|
Loading…
Reference in New Issue