X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fmenu.qc;h=efed9ff2eac775a806e2f114e67d8e185069bedb;hb=6cb19dd9f930d21b254d2c16d59f5ed4e52c4661;hp=ec94b2cdfcc0f9acdbe0f9685a608a0dae8e5fa1;hpb=74932ba6e77c934a3fa4f10522d08f33fa598a40;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index ec94b2cdf..efed9ff2e 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -672,6 +672,7 @@ void m_tooltip(vector pos) } } +const int MIN_DISCONNECTION_TIME = 1; float autocvar_menu_force_on_disconnection; bool autocvar_g_campaign; void m_draw(float width, float height) @@ -679,9 +680,9 @@ void m_draw(float width, float height) 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 > 0) + 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 @@ -689,14 +690,10 @@ void m_draw(float width, float height) cvar_set("g_campaign", "0"); m_sync(); } - } - if (autocvar_menu_force_on_disconnection > 0) - { - if (connected_time && time - connected_time > autocvar_menu_force_on_disconnection) - { + if (autocvar_menu_force_on_disconnection > 0) m_toggle(true); - connected_time = 0; - } + localcmd("\nmenu_cmd directmenu Welcome RESET\n"); + connected_time = 0; } } else