mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-27 07:04:16 +00:00
Save spawn on trigger_changelevel use
This commit is contained in:
parent
e739165fdf
commit
c2deca67c0
@ -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 )
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
l_SavedCoords.triggerangles = m_vecSpawnAngles;
|
if( m_fSpawnSaved )
|
||||||
l_SavedCoords.triggerorigin = m_vecSpawnOrigin;
|
{
|
||||||
l_SavedCoords.valid = true;
|
l_SavedCoords.triggerangles = m_vecSpawnAngles;
|
||||||
|
l_SavedCoords.triggerorigin = m_vecSpawnOrigin;
|
||||||
|
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…
x
Reference in New Issue
Block a user