diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/env_player_surface_trigger.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/env_player_surface_trigger.h')
| -rw-r--r-- | game/server/env_player_surface_trigger.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/game/server/env_player_surface_trigger.h b/game/server/env_player_surface_trigger.h new file mode 100644 index 0000000..96eb081 --- /dev/null +++ b/game/server/env_player_surface_trigger.h @@ -0,0 +1,49 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef ENV_PLAYER_SURFACE_TRIGGER_H +#define ENV_PLAYER_SURFACE_TRIGGER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "baseentity.h" +#include "entityoutput.h" + +//----------------------------------------------------------------------------- +// Purpose: Entity that fires outputs whenever the player stands on a different surface +//----------------------------------------------------------------------------- +class CEnvPlayerSurfaceTrigger : public CPointEntity +{ + DECLARE_CLASS( CEnvPlayerSurfaceTrigger, CPointEntity ); +public: + DECLARE_DATADESC(); + + ~CEnvPlayerSurfaceTrigger( void ); + void Spawn( void ); + void OnRestore( void ); + + // Main interface to all surface triggers + static void SetPlayerSurface( CBasePlayer *pPlayer, char gameMaterial ); + + void UpdateMaterialThink( void ); + +private: + void PlayerSurfaceChanged( CBasePlayer *pPlayer, char gameMaterial ); + void InputDisable( inputdata_t &inputdata ); + void InputEnable( inputdata_t &inputdata ); + +private: + int m_iTargetGameMaterial; + int m_iCurrentGameMaterial; + bool m_bDisabled; + + // Outputs + COutputEvent m_OnSurfaceChangedToTarget; + COutputEvent m_OnSurfaceChangedFromTarget; +}; + +#endif // ENV_PLAYER_SURFACE_TRIGGER_H |