Browse Source

Fix env_spritetrain not moving when needed (#373)

opfor
Roman Chistokhodov 2 years ago committed by GitHub
parent
commit
ef2a745a4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      dlls/plats.cpp

5
dlls/plats.cpp

@ -2330,7 +2330,7 @@ void CSpriteTrain::Activate( void )
if( FStringNull( pev->targetname ) ) if( FStringNull( pev->targetname ) )
{ {
m_nexting = TRUE; m_nexting = TRUE;
m_nextTime = pev->ltime + 0.1; pev->nextthink = pev->ltime + 0.1;
} }
else else
pev->spawnflags |= SF_TRAIN_WAIT_RETRIGGER; pev->spawnflags |= SF_TRAIN_WAIT_RETRIGGER;
@ -2441,12 +2441,12 @@ void CSpriteTrain::Wait()
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) );
if( pev->noiseStopMoving ) if( pev->noiseStopMoving )
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM );
pev->nextthink = 0;
return; return;
} }
if( m_flWait != 0 ) if( m_flWait != 0 )
{ {
pev->nextthink = pev->ltime + m_flWait;
if( pev->noiseMovement ) if( pev->noiseMovement )
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) );
if( pev->noiseStopMoving ) if( pev->noiseStopMoving )
@ -2474,7 +2474,6 @@ void CSpriteTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
// Pop back to last target if it's available // Pop back to last target if it's available
if( pev->enemy ) if( pev->enemy )
pev->target = pev->enemy->v.targetname; pev->target = pev->enemy->v.targetname;
pev->nextthink = 0;
pev->velocity = g_vecZero; pev->velocity = g_vecZero;
if( pev->noiseStopMoving ) if( pev->noiseStopMoving )
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM );

Loading…
Cancel
Save