From: Rudolf Polzer Date: Sat, 1 Oct 2011 14:52:01 +0000 (+0200) Subject: Revert "rewrite the use key system to always rely on the impulse for impulse actions... X-Git-Tag: xonotic-v0.6.0~74^2~275^2~8^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=99f9633d94746e80f8c0d55dcaf623677eae8a67;p=xonotic%2Fxonotic-data.pk3dir.git Revert "rewrite the use key system to always rely on the impulse for impulse actions, and use the button state for stuff that needs to know whether the button is held" This reverts commit 2ab37e6c5b9742c6561cebd084822ea70f7dfb49. --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index a290a0b4fe..a0d50e3e7a 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -53,8 +53,6 @@ alias asay_drop "say_team (%l) dropped %w ; impulse 17" alias +hook +button6 alias -hook -button6 alias use "impulse 21" -alias +usekey "use; +button10" -alias -usekey "-button10" alias ready "cmd ready" alias lockteams "sv_cmd lockteams" alias unlockteams "sv_cmd unlockteams" @@ -1041,7 +1039,7 @@ bind r reload bind BACKSPACE dropweapon bind g dropweapon // TODO change this to "use" once we can -bind f +usekey +bind f +use // misc bind e +hook diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 0693dc9138..351625bb55 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -79,7 +79,7 @@ void bot_think() self.BUTTON_INFO = 0; self.button8 = 0; self.BUTTON_CHAT = 0; - self.BUTTON_USELEGACY = 0; + self.BUTTON_USE = 0; if (time < game_starttime) { diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index fe6212e1f1..63151cac1b 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -889,7 +889,7 @@ float bot_presskeys() self.BUTTON_CROUCH = FALSE; self.BUTTON_ATCK = FALSE; self.BUTTON_ATCK2 = FALSE; - self.BUTTON_USELEGACY = FALSE; + self.BUTTON_USE = FALSE; self.BUTTON_HOOK = FALSE; self.BUTTON_CHAT = FALSE; @@ -919,7 +919,7 @@ float bot_presskeys() self.BUTTON_ATCK2 = TRUE; if(self.bot_cmd_keys & BOT_CMD_KEY_USE) - self.BUTTON_USELEGACY = TRUE; + self.BUTTON_USE = TRUE; if(self.bot_cmd_keys & BOT_CMD_KEY_HOOK) self.BUTTON_HOOK = TRUE; @@ -1047,15 +1047,15 @@ float bot_cmd_releasekey() float bot_cmd_pause() { - self.button1 = 0; - self.button8 = 0; - self.BUTTON_USELEGACY = 0; - self.BUTTON_ATCK = 0; - self.BUTTON_JUMP = 0; - self.BUTTON_HOOK = 0; - self.BUTTON_CHAT = 0; - self.BUTTON_ATCK2 = 0; - self.BUTTON_CROUCH = 0; + self.button1 = 0; + self.button8 = 0; + self.BUTTON_USE = 0; + self.BUTTON_ATCK = 0; + self.BUTTON_JUMP = 0; + self.BUTTON_HOOK = 0; + self.BUTTON_CHAT = 0; + self.BUTTON_ATCK2 = 0; + self.BUTTON_CROUCH = 0; self.movement = '0 0 0'; self.bot_cmd_keys = BOT_CMD_KEY_NONE; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index b1a2ef0503..bddb593323 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2327,7 +2327,7 @@ void SpectateCopy(entity spectatee) { self.dmg_save = spectatee.dmg_save; self.dmg_inflictor = spectatee.dmg_inflictor; self.angles = spectatee.v_angle; - if(!(self.BUTTON_USELEGACY || self.BUTTON_USEPRESSED)) + if(!self.BUTTON_USE) self.fixangle = TRUE; setorigin(self, spectatee.origin); setsize(self, spectatee.mins, spectatee.maxs); @@ -2605,7 +2605,7 @@ void ObserverThink() self.classname = "spectator"; } } else { - prefered_movetype = ((!(self.BUTTON_USELEGACY || self.BUTTON_USEPRESSED) ? self.cvar_cl_clippedspectating : !self.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP); + prefered_movetype = ((!self.BUTTON_USE ? self.cvar_cl_clippedspectating : !self.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP); if (self.movetype != prefered_movetype) self.movetype = prefered_movetype; } @@ -2774,9 +2774,9 @@ void PlayerPreThink (void) MUTATOR_CALLHOOK(PlayerPreThink); - if(self.BUTTON_USELEGACY && !self.usekeypressed) + if(self.BUTTON_USE && !self.usekeypressed) PlayerUseKey(); - self.usekeypressed = self.BUTTON_USELEGACY; + self.usekeypressed = self.BUTTON_USE; PrintWelcomeMessage(); @@ -2860,7 +2860,7 @@ void PlayerPreThink (void) { if(frametime) player_anim(); - button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USELEGACY || self.BUTTON_USEPRESSED); + button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE); force_respawn = (g_lms || g_ca || g_cts || autocvar_g_forced_respawn); if (self.deadflag == DEAD_DYING) { diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index f629297cce..b7e8bc2264 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -752,7 +752,7 @@ void SV_PlayerPhysics() anticheat_physics(); - buttons = self.BUTTON_ATCK + 2 * self.BUTTON_JUMP + 4 * self.BUTTON_ATCK2 + 8 * self.BUTTON_ZOOM + 16 * self.BUTTON_CROUCH + 32 * self.BUTTON_HOOK + 64 * (self.BUTTON_USELEGACY || self.BUTTON_USEPRESSED) + 128 * (self.movement_x < 0) + 256 * (self.movement_x > 0) + 512 * (self.movement_y < 0) + 1024 * (self.movement_y > 0); + buttons = self.BUTTON_ATCK + 2 * self.BUTTON_JUMP + 4 * self.BUTTON_ATCK2 + 8 * self.BUTTON_ZOOM + 16 * self.BUTTON_CROUCH + 32 * self.BUTTON_HOOK + 64 * self.BUTTON_USE + 128 * (self.movement_x < 0) + 256 * (self.movement_x > 0) + 512 * (self.movement_y < 0) + 1024 * (self.movement_y > 0); if(!buttons) c = "x"; @@ -799,7 +799,7 @@ void SV_PlayerPhysics() { // slight annoyance for nick change scripts self.movement = -1 * self.movement; - self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = self.BUTTON_ZOOM = self.BUTTON_CROUCH = self.BUTTON_HOOK = self.BUTTON_USELEGACY = self.BUTTON_USEPRESSED = 0; + self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = self.BUTTON_ZOOM = self.BUTTON_CROUCH = self.BUTTON_HOOK = self.BUTTON_USE = 0; if(self.nickspamcount >= autocvar_g_nick_flood_penalty_red) // if you are persistent and the slight annoyance above does not stop you, I'll show you! { diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index a71df8f2e0..bc05d1b048 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -10,10 +10,9 @@ float require_spawnfunc_prefix; // if this float exists, only functions with spa #define BUTTON_HOOK button6 #define BUTTON_INFO button7 #define BUTTON_CHAT buttonchat -#define BUTTON_USELEGACY buttonuse +#define BUTTON_USE buttonuse #define BUTTON_DRAG button8 #define BUTTON_ZOOMSCRIPT button9 -#define BUTTON_USEPRESSED button10 // Globals diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index a5e3a080c9..09daa245ac 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1356,7 +1356,7 @@ void IntermissionThink() return; if(!mapvote_initialized) - if (time < intermission_exittime + 10 || !(self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USELEGACY || self.BUTTON_USEPRESSED)) + if (time < intermission_exittime + 10 && !self.BUTTON_ATCK && !self.BUTTON_JUMP && !self.BUTTON_ATCK2 && !self.BUTTON_HOOK && !self.BUTTON_USE) return; MapVote_Start(); diff --git a/qcsrc/server/playerdemo.qc b/qcsrc/server/playerdemo.qc index e334de72e8..631c10dcbb 100644 --- a/qcsrc/server/playerdemo.qc +++ b/qcsrc/server/playerdemo.qc @@ -49,7 +49,6 @@ void playerdemo_open_write(string f) PLAYERDEMO_FIELD(func,string,playermodel) \ PLAYERDEMO_FIELD(func,float,skin) \ PLAYERDEMO_FIELD(func,string,playerskin) \ - PLAYERDEMO_FIELD(func,float,impulse) \ PLAYERDEMO_FIELD(func,float,frame) \ PLAYERDEMO_FIELD(func,float,effects) \ PLAYERDEMO_FIELD(func,float,switchweapon) \ @@ -57,6 +56,7 @@ void playerdemo_open_write(string f) PLAYERDEMO_FIELD(func,float,BUTTON_ATCK2) \ PLAYERDEMO_FIELD(func,float,BUTTON_CROUCH) \ PLAYERDEMO_FIELD(func,float,BUTTON_HOOK) \ + PLAYERDEMO_FIELD(func,float,BUTTON_USE) \ PLAYERDEMO_FIELD(func,float,flags) \ // end of list diff --git a/qcsrc/server/vehicles/vehicles.qc b/qcsrc/server/vehicles/vehicles.qc index dd59ebb989..6006dcf92e 100644 --- a/qcsrc/server/vehicles/vehicles.qc +++ b/qcsrc/server/vehicles/vehicles.qc @@ -606,7 +606,7 @@ void vehicles_exit(float eject) self.owner.event_damage = PlayerDamage; self.owner.hud = HUD_NORMAL; self.owner.switchweapon = self.switchweapon; - //self.owner.BUTTON_USELEGACY = 0; + //self.owner.BUTTON_USE = 0; } if(self.deadflag == DEAD_NO)