]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge remote branch 'refs/remotes/origin/fruitiex/racefixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 6f8b8e4fb5f85600ac78c1e99ab017d48aea6f75..a20c31dd63e18ee5d133bf46dc62b970b1414e8d 100644 (file)
@@ -578,9 +578,19 @@ void GetCvars_handleFloatOnce(string thisname, float f, .float field, string nam
                        stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
        }
 }
-string W_FixWeaponOrder_ForceComplete(string s);
-string W_FixWeaponOrder_AllowIncomplete(string s);
 float w_getbestweapon(entity e);
+string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(string wo)
+{
+       string o;
+       o = W_FixWeaponOrder_ForceComplete(wo);
+       if(self.weaponorder_byimpulse)
+       {
+               strunzone(self.weaponorder_byimpulse);
+               self.weaponorder_byimpulse = string_null;
+       }
+       self.weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(o));
+       return o;
+}
 void GetCvars(float f)
 {
        string s;
@@ -597,7 +607,7 @@ void GetCvars(float f)
        GetCvars_handleFloat(s, f, cvar_cl_shownames, "cl_shownames");
        GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion");
        GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap");
-       GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete);
+       GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[0], "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete);
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[1], "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete);
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[2], "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete);
@@ -1720,7 +1730,6 @@ void precache()
 #define INITPRIO_FIRST              0
 #define INITPRIO_GAMETYPE           0
 #define INITPRIO_GAMETYPE_FALLBACK  1
-#define INITPRIO_CVARS              5
 #define INITPRIO_FINDTARGET        10
 #define INITPRIO_DROPTOFLOOR       20
 #define INITPRIO_SETLOCATION       90
@@ -2295,10 +2304,8 @@ string getladder()
                for (i = 0; i <= LADDER_CNT; ++i) { // i = 0 because it is the speed award
                        if(i == 0) // speed award
                        {
-                               print("^1Hit! ", db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, rr, "speed/speed")), "\n");
                                if(stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, rr, "speed/speed"))) == 0)
                                        continue;
-                               print("^1Also hit after\n");
 
                                myuid = db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, rr, "speed/crypto_idfp"));
                        }