]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/Main.qc
fix & cleanup cl_vyes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / Main.qc
index 9ed7d92e3630a5c6e115c3c044ba98390f7b8fd7..c3d1afb6f421bf02725f8b68595004dcf9631a8e 100644 (file)
@@ -186,7 +186,10 @@ void CSQC_Shutdown(void)
        remove(players);
        db_close(binddb);
        db_close(tempdb);
-       db_save(ClientProgsDB, "client.db");
+       if(cvar("cl_db_saveasdump"))
+               db_dump(ClientProgsDB, "client.db");
+       else
+               db_save(ClientProgsDB, "client.db");
        db_close(ClientProgsDB);
 
        cvar_clientsettemp_restore();
@@ -605,6 +608,35 @@ void GameCommand(string msg)
                e.draw = DrawDebugModel;
                e.classname = "debugmodel";
        }
+    else if(cmd == "vyes")
+    {
+        if(uid2name_dialog)
+        {
+            vote_active = 0; // force the panel to disappear right as we have selected the value (to prevent it from fading out in the normal vote panel pos)
+            vote_prev = 0;
+            cvar_set("cl_allow_uid2name", "1");
+            vote_change = -9999;
+        }
+        else
+        {
+            localcmd("vyes\n");
+        }
+    }
+    else if(cmd == "vno")
+    {
+        if(uid2name_dialog)
+        {
+            vote_active = 0;
+            vote_prev = 0;
+            cvar_set("cl_allow_uid2name", "0");
+            vote_change = -9999;
+        }
+        else
+        {
+            localcmd("vno\n");
+        }
+    }
+
        else
        {
                print("Invalid command. For a list of supported commands, try cl_cmd help.\n");
@@ -633,6 +665,7 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if(menu_visible)
                if(menu_action(bInputType, nPrimary, nSecondary))
                        return TRUE;
+
        return bSkipKey;
 }
 
@@ -1033,12 +1066,16 @@ void Ent_Init()
 
        g_weaponswitchdelay = ReadByte() / 255.0;
 
-       g_balance_grenadelauncher_secondary_bouncefactor = ReadCoord();
-       g_balance_grenadelauncher_secondary_bouncestop = ReadCoord();
+       g_balance_grenadelauncher_bouncefactor = ReadCoord();
+       g_balance_grenadelauncher_bouncestop = ReadCoord();
+       g_balance_electro_secondary_bouncefactor = ReadCoord();
+       g_balance_electro_secondary_bouncestop = ReadCoord();
 
        nex_scope = !ReadByte();
        campingrifle_scope = !ReadByte();
 
+       serverflags = ReadByte();
+
        if(!postinit)
                PostInit();
 }