From bba4978faed0ce7058b1beaf827fd0d6af3fe0c8 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 1 Oct 2011 16:57:15 +0200 Subject: [PATCH] do the +use -> use transition PROPERLY --- defaultXonotic.cfg | 1 + qcsrc/server/cl_client.qc | 9 ++++++--- qcsrc/server/defs.qh | 1 + qcsrc/server/miscfunctions.qc | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 025ceeef21..883f8efcea 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -54,6 +54,7 @@ alias +hook +button6 alias -hook -button6 alias use "impulse 21" alias +use use // always send that impulse AND press the key (+use is engine internal command and executes anyway) +set cl_newusekeysupported 1 // indicates that we always send the use impulse too, so they do not need to be synthesized alias ready "cmd ready" alias lockteams "sv_cmd lockteams" alias unlockteams "sv_cmd unlockteams" diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index bddb593323..6ee5dfc3c3 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2774,9 +2774,12 @@ void PlayerPreThink (void) MUTATOR_CALLHOOK(PlayerPreThink); - if(self.BUTTON_USE && !self.usekeypressed) - PlayerUseKey(); - self.usekeypressed = self.BUTTON_USE; + if(!self.cvar_cl_newusekeysupported) + { + if(self.BUTTON_USE && !self.usekeypressed) + PlayerUseKey(); + self.usekeypressed = self.BUTTON_USE; + } PrintWelcomeMessage(); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index bc05d1b048..9f4631a47c 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -315,6 +315,7 @@ float default_weapon_alpha; .float cvar_cl_playerdetailreduction; .float cvar_cl_clippedspectating; .float cvar_cl_movement_track_canjump; +.float cvar_cl_newusekeysupported; .string cvar_g_xonoticversion; .string cvar_cl_weaponpriority; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 9a848fa46e..19465d09dd 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -617,6 +617,7 @@ void GetCvars(float f) GetCvars_handleFloat(s, f, cvar_cl_allow_uid2name, "cl_allow_uid2name"); GetCvars_handleFloat(s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking"); GetCvars_handleFloat(s, f, cvar_cl_movement_track_canjump, "cl_movement_track_canjump"); + GetCvars_handleFloat(s, f, cvar_cl_newusekeysupported, "cl_newusekeysupported"); // fixup of switchweapon (needed for LMS or when spectating is disabled, as PutClientInServer comes too early) if (f > 0) -- 2.39.2