static float connected_time;
if (clientstate() == CS_DISCONNECTED)
{
- if (autocvar_g_campaign)
+ if (connected_time && time - connected_time > MIN_DISCONNECTION_TIME)
{
- if (connected_time && time - connected_time > MIN_DISCONNECTION_TIME)
+ if (autocvar_g_campaign)
{
// in the case player uses the disconnect command (in the console or with a key)
// reset g_campaign and update menu items to reflect cvar values that may have been restored after quiting the campaign
cvar_set("g_campaign", "0");
m_sync();
}
- }
- if (autocvar_menu_force_on_disconnection > 0)
- {
- if (connected_time && time - connected_time > MIN_DISCONNECTION_TIME)
- {
+ if (autocvar_menu_force_on_disconnection > 0)
m_toggle(true);
- }
- }
- if (connected_time && time - connected_time > MIN_DISCONNECTION_TIME)
- {
localcmd("\nmenu_cmd directmenu Welcome RESET\n");
connected_time = 0;
}