mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-02-01 20:30:57 +00:00
Conditionally disable bunny hopping (speed jumping). To disable bunny hopping
on your server, put `serverinfo no_pogo_stick 1' into your server.cfg. It's called no_pogo_stick for two reasons: the effect is called "pogo stick" in the source code in a comment from the original id source code and also as a minor (and very week:/) obfustication for `cheaters' trying to set it in their clients. However, the client checks for no_pogo_stick in the server info and forces it on when appropriate and having them in disagreement would only make prediction a little screwy anyway :). BTW, when enabled this actually fixes the original bug that allowed bunny hopping in the first place (though you still get a jump grunt when you try to bunny hop; minor bug).
This commit is contained in:
parent
9dc1c00a16
commit
1dd0f7ed0f
3 changed files with 15 additions and 7 deletions
|
@ -100,7 +100,7 @@ typedef struct {
|
|||
float entgravity;
|
||||
} movevars_t;
|
||||
|
||||
|
||||
extern struct cvar_s *no_pogo_stick;
|
||||
extern movevars_t movevars;
|
||||
extern playermove_t pmove;
|
||||
extern int onground;
|
||||
|
|
|
@ -1478,6 +1478,9 @@ void Host_Frame (float time)
|
|||
// fetch results from server
|
||||
CL_ReadPackets ();
|
||||
|
||||
if (atoi(Info_ValueForKey(cl.serverinfo, "no_pogo_stick")))
|
||||
Cvar_Set (no_pogo_stick, "1");
|
||||
|
||||
// send intentions now
|
||||
// resend a connection request if necessary
|
||||
if (cls.state == ca_disconnected) {
|
||||
|
|
|
@ -33,10 +33,11 @@
|
|||
#include "qtypes.h"
|
||||
#include "client.h"
|
||||
#include "pmove.h"
|
||||
#include "cvar.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
cvar_t *no_pogo_stick;
|
||||
movevars_t movevars;
|
||||
|
||||
playermove_t pmove;
|
||||
|
@ -68,6 +69,8 @@ void PM_CategorizePosition (void);
|
|||
void Pmove_Init (void)
|
||||
{
|
||||
PM_InitBoxHull ();
|
||||
no_pogo_stick = Cvar_Get ("no_pogo_stick", "0", CVAR_SERVERINFO,
|
||||
"disable the ability to pogo stick");
|
||||
}
|
||||
|
||||
#define STEPSIZE 18
|
||||
|
@ -718,11 +721,10 @@ void PM_CategorizePosition (void)
|
|||
|
||||
|
||||
/*
|
||||
=============
|
||||
JumpButton
|
||||
=============
|
||||
JumpButton
|
||||
*/
|
||||
void JumpButton (void)
|
||||
void
|
||||
JumpButton (void)
|
||||
{
|
||||
if (pmove.dead)
|
||||
{
|
||||
|
@ -751,8 +753,11 @@ void JumpButton (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (onground == -1)
|
||||
if (onground == -1) {
|
||||
if (no_pogo_stick->int_val)
|
||||
pmove.oldbuttons |= BUTTON_JUMP;// don't jump again until released
|
||||
return; // in air, so no effect
|
||||
}
|
||||
|
||||
if ( pmove.oldbuttons & BUTTON_JUMP )
|
||||
return; // don't pogo stick
|
||||
|
|
Loading…
Reference in a new issue