|
|
|
@ -78,16 +78,22 @@ Vector FixupSpawnPoint(Vector spawn)
@@ -78,16 +78,22 @@ Vector FixupSpawnPoint(Vector spawn)
|
|
|
|
|
} |
|
|
|
|
return spawn; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
extern EHANDLE g_pLastSpawn; |
|
|
|
|
//=========================================================
|
|
|
|
|
//=========================================================
|
|
|
|
|
edict_t *CGameRules::GetPlayerSpawnSpot( CBasePlayer *pPlayer ) |
|
|
|
|
{ |
|
|
|
|
edict_t *pentSpawnSpot = EntSelectSpawnPoint( pPlayer ); |
|
|
|
|
if( pPlayer->m_state == STATE_POINT_SELECT ) |
|
|
|
|
{ |
|
|
|
|
pPlayer->m_state = STATE_SPAWNED; |
|
|
|
|
return pentSpawnSpot; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( mp_coop.value ) |
|
|
|
|
UTIL_CleanSpawnPoint( pentSpawnSpot->v.origin, 100 ); |
|
|
|
|
|
|
|
|
|
if( g_pLastSpawn ) |
|
|
|
|
pPlayer->pev->origin = VARS( pentSpawnSpot )->origin + Vector( 0, 0, 1 ); |
|
|
|
|
pPlayer->pev->v_angle = g_vecZero; |
|
|
|
|
pPlayer->pev->velocity = g_vecZero; |
|
|
|
@ -95,7 +101,25 @@ edict_t *CGameRules::GetPlayerSpawnSpot( CBasePlayer *pPlayer )
@@ -95,7 +101,25 @@ edict_t *CGameRules::GetPlayerSpawnSpot( CBasePlayer *pPlayer )
|
|
|
|
|
pPlayer->pev->punchangle = g_vecZero; |
|
|
|
|
if( !(pPlayer->pev->flags & FL_SPECTATOR ) ) |
|
|
|
|
if( mp_coop_changelevel.value && !CoopRestorePlayerCoords( pPlayer, &pPlayer->pev->origin, &pPlayer->pev->angles )) |
|
|
|
|
CoopGetSpawnPoint( &pPlayer->pev->origin, &pPlayer->pev->angles ); |
|
|
|
|
if( !CoopGetSpawnPoint( &pPlayer->pev->origin, &pPlayer->pev->angles ) ) |
|
|
|
|
{ |
|
|
|
|
if( pPlayer->m_state == STATE_SPAWNED && !g_pLastSpawn ) |
|
|
|
|
{ |
|
|
|
|
hudtextparms_t params = {}; |
|
|
|
|
params.fadeinTime = 0.5; |
|
|
|
|
params.fadeoutTime = .5; |
|
|
|
|
params.holdTime = 10; |
|
|
|
|
params.channel = 1; |
|
|
|
|
params.y = 100; |
|
|
|
|
params.r2 = params.g2 = params.b2 = params.a2 = params.r1 = params.g1 = params.b1 = params.a1 = 255; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UTIL_HudMessage( pPlayer, params, "Server cannot select a spawnpoint, please fly to it manually and press attack button\n" ); |
|
|
|
|
// select spawn point
|
|
|
|
|
pPlayer->m_state = STATE_POINT_SELECT; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
pPlayer->pev->fixangle = TRUE; |
|
|
|
|
pPlayer->pev->origin = FixupSpawnPoint( pPlayer->pev->origin ); |
|
|
|
|
if( g_fSavedDuck ) |
|
|
|
|