Created 2 years ago2022-08-06 18:13:51 UTC by JacksBestGaming
void CChangeLevel :: ChangeLevelNow( CBaseEntity *pActivator )
{
edict_t *pentLandmark;
LEVELLIST levels[16];
ASSERT(!FStrEq(m_szMapName, ""));
// Don't work in deathmatch
if ( g_pGameRules->IsDeathmatch() )
return;
// Some people are firing these multiple times in a frame, disable
if ( gpGlobals->time == pev->dmgtime )
return;
pev->dmgtime = gpGlobals->time;
Simply removing these will NOT actually do it:
// Don't work in deathmatch
if ( g_pGameRules->IsDeathmatch() )
return;
Instead, you should modify it like this:
// Yes, work in deathmatch
if ( g_pGameRules->IsDeathmatch() )
{
CHANGE_LEVEL( m_szMapName, nullptr );
return;
}
In singleplayer, it changes the level with regards to a landmark, equivalent to calling the changelevel2
console command.nullptr
to the landmark parameter, which is the same as using the changelevel
console command. This means your player(s) will spawn at info_player_deathmatch points in the next map and won't actually carry over smoothly.