mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-08 21:14:14 +00:00
Move checkpoints check
This commit is contained in:
parent
a837174564
commit
ab4fc25e67
@ -686,3 +686,29 @@ void UTIL_CoopShowMenu( CBasePlayer *pPlayer, const char *title, int count, cons
|
||||
}
|
||||
//CLIENT_COMMAND( pPlayer->edict(), "exec touch_default/numbers.cfg\n");
|
||||
}
|
||||
|
||||
bool UTIL_CoopConfirmMenu(CBaseEntity *pTrigger, CBaseEntity *pActivator, int count2, char *mapname )
|
||||
{
|
||||
if( gpGlobals->time - g_GlobalMenu.m_flTime > 30 )
|
||||
{
|
||||
g_iMenu = 0;
|
||||
g_GlobalMenu.m_iConfirm = 0;
|
||||
}
|
||||
if( g_iMenu != 1 )
|
||||
{
|
||||
if( !UTIL_CoopIsBadPlayer( pActivator ) )
|
||||
g_GlobalMenu.ConfirmMenu( (CBasePlayer*)pActivator, pTrigger, mapname );
|
||||
return false;
|
||||
}
|
||||
if( g_GlobalMenu.m_iConfirm < count2 )
|
||||
return false;
|
||||
//if( mp_coop_strongpolicy.value )
|
||||
{
|
||||
// do not allow go back if there are checkpoints, but not near changelevel
|
||||
if( g_checkpoints[0].time && (g_checkpoints[0].origin - VecBModelOrigin(pTrigger->pev)).Length() > 150 )
|
||||
return false;
|
||||
//if( count2 < 2 )
|
||||
//return;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ void UTIL_BecomeSpectator( CBasePlayer *pPlayer );
|
||||
void UTIL_CoopCheckpointMenu( CBasePlayer *pPlayer );
|
||||
void UTIL_CoopVoteMenu( CBasePlayer *pPlayer );
|
||||
void UTIL_CoopShowMenu( CBasePlayer *pPlayer, const char *title, int count, const char **slot, signed char time = -1 );
|
||||
bool UTIL_CoopConfirmMenu( CBaseEntity *pTrigger, CBaseEntity *pActivator, int count2, char *mapname );
|
||||
extern int g_iMenu;
|
||||
|
||||
// Show to all spawned players: voting, etc..
|
||||
|
@ -1398,7 +1398,7 @@ void CChangeLevel::KeyValue( KeyValueData *pkvd )
|
||||
else
|
||||
CBaseTrigger::KeyValue( pkvd );
|
||||
}
|
||||
bool CoopGetSpawnPoint( Vector *origin, Vector *angles);
|
||||
|
||||
/*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION
|
||||
When the player touches this, he gets sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
|
||||
*/
|
||||
@ -1721,29 +1721,8 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
|
||||
// return;
|
||||
|
||||
if( m_fIsBack )
|
||||
{
|
||||
if( gpGlobals->time - g_GlobalMenu.m_flTime > 30 )
|
||||
{
|
||||
g_iMenu = 0;
|
||||
g_GlobalMenu.m_iConfirm = 0;
|
||||
}
|
||||
if( g_iMenu != 1 )
|
||||
{
|
||||
if( !UTIL_CoopIsBadPlayer( pActivator ) )
|
||||
g_GlobalMenu.ConfirmMenu( (CBasePlayer*)pActivator, this, m_szMapName );
|
||||
if( !UTIL_CoopConfirmMenu( this, pActivator, count2, m_szMapName ) )
|
||||
return;
|
||||
}
|
||||
if( g_GlobalMenu.m_iConfirm < count2 )
|
||||
return;
|
||||
//if( mp_coop_strongpolicy.value )
|
||||
/*{
|
||||
// do not allow go back if there are checkpoints, but not near changelevel
|
||||
if( g_checkpoints[0].time && (g_checkpoints[0].origin - VecBModelOrigin(pev)).Length() > 150 )
|
||||
return;
|
||||
if( count2 < 2 )
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
if( m_fSpawnSaved )
|
||||
|
Loading…
x
Reference in New Issue
Block a user