2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-25 11:19:39 +01:00

Fix momentary_door sounds

This commit is contained in:
Roman Chistokhodov 2019-05-13 01:08:25 +03:00 committed by Alibek Omarov
parent ef9129b89e
commit 60bb207ff4

View File

@ -926,6 +926,7 @@ public:
void Spawn( void );
void Precache( void );
void EXPORT MomentaryMoveDone( void );
void EXPORT StopMoveSound( void );
void KeyValue( KeyValueData *pkvd );
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
@ -1117,7 +1118,15 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
}
void CMomentaryDoor::MomentaryMoveDone( void )
{
SetThink(&CMomentaryDoor::StopMoveSound);
pev->nextthink = pev->ltime + 0.1;
}
void CMomentaryDoor::StopMoveSound()
{
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM );
pev->nextthink = -1;
ResetThink();
}