X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=a20c31dd63e18ee5d133bf46dc62b970b1414e8d;hp=bcec7355895744cf74a9887c31f8564b59fd0225;hb=4fc59bbd7e2d4f25ba21952ed50ae754295a7faa;hpb=797caeb0a822de33e479ea46102ce221cf5cb5a7 diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index bcec73558..a20c31dd6 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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