Browse Source

Save spawn on trigger_changelevel use

hlzbot-dirty
mittorn 8 years ago
parent
commit
c2deca67c0
  1. 16
      dlls/triggers.cpp

16
dlls/triggers.cpp

@ -1648,7 +1648,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
m_uTouchCount |= 1 << ( ENTINDEX( pActivator->edict() ) - 1); m_uTouchCount |= 1 << ( ENTINDEX( pActivator->edict() ) - 1);
// Keep first toucher coords to save correct spawn angles // Keep first toucher coords to save correct spawn angles
if( !m_fSpawnSaved ) if( !m_fSpawnSaved && pActivator->IsPlayer() )
{ {
m_vecSpawnOrigin = pActivator->pev->origin; m_vecSpawnOrigin = pActivator->pev->origin;
m_vecSpawnAngles = pActivator->pev->angles; m_vecSpawnAngles = pActivator->pev->angles;
@ -1737,11 +1737,25 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
}*/ }*/
} }
if( m_fSpawnSaved )
{
l_SavedCoords.triggerangles = m_vecSpawnAngles; l_SavedCoords.triggerangles = m_vecSpawnAngles;
l_SavedCoords.triggerorigin = m_vecSpawnOrigin; l_SavedCoords.triggerorigin = m_vecSpawnOrigin;
l_SavedCoords.valid = true; l_SavedCoords.valid = true;
}
ALERT( at_console, "^2CHANGELEVEL:^7 %d %d %d\n", count2, count1, (int)m_fIsBack); ALERT( at_console, "^2CHANGELEVEL:^7 %d %d %d\n", count2, count1, (int)m_fIsBack);
} }
else
{
// Get current player's coordinated
if( pActivator && pActivator->IsPlayer() )
{
l_SavedCoords.triggerangles = pActivator->pev->angles;
l_SavedCoords.triggerorigin = pActivator->pev->origin;
l_SavedCoords.valid = true;
}
}
CoopSaveTrain( pActivator, &l_SavedCoords ); CoopSaveTrain( pActivator, &l_SavedCoords );
g_SavedCoords = l_SavedCoords; g_SavedCoords = l_SavedCoords;

Loading…
Cancel
Save