Fixed buy, hostage, bomb zones detections
This commit is contained in:
parent
ba82e0f107
commit
3306fd5b21
10 changed files with 43 additions and 33 deletions
|
@ -2231,10 +2231,6 @@ void C_CSPlayer::Simulate( void )
|
|||
void C_CSPlayer::PostThink()
|
||||
{
|
||||
BaseClass::PostThink();
|
||||
// Reset this.. it gets reset each frame that we're in a bomb zone.
|
||||
m_bInBombZone = false;
|
||||
m_bInBuyZone = false;
|
||||
m_bInHostageRescueZone = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
void CCSPrediction::StartCommand(CBasePlayer* player, CUserCmd* cmd)
|
||||
{
|
||||
CCSPlayer *pPlayer = ToCSPlayer( player );
|
||||
CCSPlayer* pPlayer = ToCSPlayer(player);
|
||||
|
||||
BaseClass::StartCommand( player, cmd );
|
||||
}
|
||||
|
|
|
@ -888,12 +888,9 @@ void CPrediction::RunCommand( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper
|
|||
g_pGameMovement->StartTrackPredictionErrors( player );
|
||||
|
||||
gpGlobals->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
|
||||
// Run post think after PreThink/Think function, this makes a room space for local interpolation.
|
||||
gpGlobals->curtime = (player->m_nTickBase - 1) * TICK_INTERVAL;
|
||||
|
||||
RunPostThink( player );
|
||||
gpGlobals->curtime = player->m_nTickBase * TICK_INTERVAL;
|
||||
|
||||
gpGlobals->curtime = player->m_nTickBase * TICK_INTERVAL;
|
||||
RunPostThink( player );
|
||||
|
||||
// TODO
|
||||
// TODO: Check for impulse predicted?
|
||||
|
|
|
@ -1584,7 +1584,7 @@ void CCSPlayer::UpdateMouseoverHints()
|
|||
}
|
||||
|
||||
void CCSPlayer::PostThink()
|
||||
{
|
||||
{
|
||||
BaseClass::PostThink();
|
||||
|
||||
UpdateAddonBits();
|
||||
|
@ -1629,12 +1629,7 @@ void CCSPlayer::PostThink()
|
|||
{
|
||||
StopSound( "Player.AmbientUnderWater" );
|
||||
SetPlayerUnderwater( false );
|
||||
}
|
||||
|
||||
// Reset this.. it gets reset each frame that we're in a bomb zone.
|
||||
m_bInBombZone = false;
|
||||
m_bInBuyZone = false;
|
||||
m_bInHostageRescueZone = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,11 +52,6 @@ void CCSPlayerMove::StartCommand( CBasePlayer *player, CUserCmd *cmd )
|
|||
{
|
||||
CCSPlayer *pPlayer = ToCSPlayer( player );
|
||||
|
||||
// Reset this.. it gets reset each frame that we're in a bomb zone.
|
||||
pPlayer->m_bInBombZone = false;
|
||||
pPlayer->m_bInBuyZone = false;
|
||||
pPlayer->m_bInHostageRescueZone = false;
|
||||
|
||||
BaseClass::StartCommand( player, cmd );
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ LINK_ENTITY_TO_CLASS( func_bomb_target, CBombTarget );
|
|||
|
||||
BEGIN_DATADESC( CBombTarget )
|
||||
DEFINE_FUNCTION( BombTargetTouch ),
|
||||
DEFINE_FUNCTION( BombTargetUse ), //needed?
|
||||
DEFINE_FUNCTION( BombTargetUse ),
|
||||
DEFINE_FUNCTION( EndTouch ),
|
||||
|
||||
// Inputs
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "BombExplode", OnBombExplode ),
|
||||
|
@ -60,6 +61,15 @@ void CBombTarget::BombTargetTouch( CBaseEntity* pOther )
|
|||
}
|
||||
}
|
||||
|
||||
void CBombTarget::EndTouch(CBaseEntity* pOther)
|
||||
{
|
||||
CCSPlayer *p = dynamic_cast< CCSPlayer* >( pOther );
|
||||
if ( p )
|
||||
{
|
||||
p->m_bInBombZone = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CBombTarget::BombTargetUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
|
||||
{
|
||||
//SUB_UseTargets( NULL, USE_TOGGLE, 0 );
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
bool IsHeistBombTarget( void ) { return m_bIsHeistBombTarget; }
|
||||
const char *GetBombMountTarget( void ){ return STRING( m_szMountTarget ); }
|
||||
|
||||
virtual void EndTouch( CBaseEntity *pOther );
|
||||
private:
|
||||
COutputEvent m_OnBombExplode; //Fired when the bomb explodes
|
||||
COutputEvent m_OnBombPlanted; //Fired when the bomb is planted
|
||||
|
|
|
@ -23,6 +23,7 @@ public:
|
|||
CBuyZone();
|
||||
void Spawn();
|
||||
void EXPORT BuyZoneTouch( CBaseEntity* pOther );
|
||||
virtual void EndTouch( CBaseEntity *pOther );
|
||||
|
||||
public:
|
||||
int m_LegacyTeamNum;
|
||||
|
@ -33,7 +34,7 @@ LINK_ENTITY_TO_CLASS( func_buyzone, CBuyZone );
|
|||
|
||||
BEGIN_DATADESC( CBuyZone )
|
||||
DEFINE_FUNCTION( BuyZoneTouch ),
|
||||
|
||||
DEFINE_FUNCTION( EndTouch ),
|
||||
// This is here to support maps that haven't updated to using "teamnum" yet.
|
||||
DEFINE_INPUT( m_LegacyTeamNum, FIELD_INTEGER, "team" )
|
||||
END_DATADESC()
|
||||
|
@ -70,8 +71,16 @@ void CBuyZone::BuyZoneTouch( CBaseEntity* pOther )
|
|||
// compare player team with buy zone team number
|
||||
if ( p->GetTeamNumber() == GetTeamNumber() )
|
||||
{
|
||||
p->m_bInBuyZone = true;
|
||||
p->m_bInBuyZone = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CBuyZone::EndTouch( CBaseEntity* pOther )
|
||||
{
|
||||
CCSPlayer *p = dynamic_cast< CCSPlayer* >( pOther );
|
||||
if ( p )
|
||||
{
|
||||
p->m_bInBuyZone = false;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "cbase.h"
|
||||
#include "triggers.h"
|
||||
#include "cs_player.h"
|
||||
|
||||
class CHostageRescueZone : public CBaseTrigger
|
||||
{
|
||||
|
@ -17,6 +18,8 @@ public:
|
|||
void Spawn();
|
||||
|
||||
void HostageRescueTouch( CBaseEntity* pOther );
|
||||
|
||||
virtual void EndTouch( CBaseEntity *pOther );
|
||||
};
|
||||
|
||||
|
||||
|
@ -43,3 +46,11 @@ void CHostageRescueZone::HostageRescueTouch( CBaseEntity *pOther )
|
|||
pOther->AcceptInput( "OnRescueZoneTouch", NULL, NULL, emptyVariant, 0 );
|
||||
}
|
||||
|
||||
void CHostageRescueZone::EndTouch( CBaseEntity* pOther )
|
||||
{
|
||||
CCSPlayer *p = dynamic_cast< CCSPlayer* >( pOther );
|
||||
if ( p )
|
||||
{
|
||||
p->m_bInHostageRescueZone = true;
|
||||
}
|
||||
}
|
|
@ -339,12 +339,12 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
|
|||
return; // Don't process this command
|
||||
}
|
||||
|
||||
gpGlobals->frametime = playerFrameTime;
|
||||
gpGlobals->curtime = player->m_nTickBase * TICK_INTERVAL;
|
||||
|
||||
StartCommand( player, ucmd );
|
||||
|
||||
g_pGameMovement->StartTrackPredictionErrors( player );
|
||||
|
||||
gpGlobals->frametime = playerFrameTime;
|
||||
gpGlobals->curtime = (player->m_nTickBase - 1) * TICK_INTERVAL;
|
||||
|
||||
if (ucmd->debug_hitboxes)
|
||||
{
|
||||
|
@ -363,11 +363,7 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
|
|||
lagcompensation->FinishLagCompensation( player );
|
||||
}
|
||||
|
||||
// Run post think first, this will let some space for client side interpolation.
|
||||
RunPostThink( player );
|
||||
|
||||
// Set globals appropriately
|
||||
gpGlobals->curtime = player->m_nTickBase * TICK_INTERVAL;
|
||||
RunPostThink( player );
|
||||
|
||||
// Prevent hacked clients from sending us invalid view angles to try to get leaf server code to crash
|
||||
if ( !ucmd->viewangles.IsValid() || !IsEntityQAngleReasonable(ucmd->viewangles) )
|
||||
|
|
Loading…
Reference in a new issue