mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 13:50:53 +00:00
Wall jumping... and stuff.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@711 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
ab3644ddf4
commit
73aa56a830
7 changed files with 38 additions and 15 deletions
|
@ -1118,6 +1118,7 @@ void CL_CheckServerInfo(void)
|
|||
cl.bunnyspeedcap = Q_atof(Info_ValueForKey(cl.serverinfo, "pm_bunnyspeedcap"));
|
||||
movevars.slidefix = (Q_atof(Info_ValueForKey(cl.serverinfo, "pm_slidefix")) != 0);
|
||||
movevars.airstep = (Q_atof(Info_ValueForKey(cl.serverinfo, "pm_airstep")) != 0);
|
||||
movevars.walljump = (Q_atof(Info_ValueForKey(cl.serverinfo, "pm_walljump")) != 0);
|
||||
movevars.ktjump = Q_atof(Info_ValueForKey(cl.serverinfo, "pm_ktjump"));
|
||||
|
||||
// Initialize cl.maxpitch & cl.minpitch
|
||||
|
|
|
@ -702,7 +702,7 @@ long UI_SystemCallsEx(void *offset, unsigned int mask, int fn, const long *arg)
|
|||
|
||||
case UI_DRAW_IMAGE:
|
||||
if (Draw_Image)
|
||||
Draw_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), (qpic_t *)VM_LONG(arg[8]));
|
||||
Draw_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), (mpic_t *)VM_LONG(arg[8]));
|
||||
break;
|
||||
|
||||
case UI_LERP_TAG: //Lerp tag...
|
||||
|
|
|
@ -168,6 +168,15 @@ int PM_SlideMove (void)
|
|||
//
|
||||
for (i=0 ; i<numplanes ; i++)
|
||||
{
|
||||
if (movevars.walljump && planes[i][2] != 1 //not on floors
|
||||
&& Length(pmove.velocity)>200 && pmove.cmd.buttons & 2 && !pmove.jump_held)
|
||||
{
|
||||
PM_ClipVelocity (original_velocity, planes[i], pmove.velocity, 2);
|
||||
pmove.velocity[2] = 270;
|
||||
pmove.jump_msec = pmove.cmd.msec;
|
||||
pmove.jump_held = true;
|
||||
return 0;
|
||||
}
|
||||
PM_ClipVelocity (original_velocity, planes[i], pmove.velocity, 1);
|
||||
for (j=0 ; j<numplanes ; j++)
|
||||
if (j != i)
|
||||
|
|
|
@ -123,6 +123,7 @@ typedef struct {
|
|||
float ktjump;
|
||||
qboolean slidefix;
|
||||
qboolean airstep;
|
||||
qboolean walljump;
|
||||
} movevars_t;
|
||||
|
||||
|
||||
|
|
|
@ -2628,6 +2628,8 @@ void SVQ2_ClearEvents(void)
|
|||
#endif
|
||||
|
||||
|
||||
void SetUpClientEdict (client_t *cl, edict_t *ent);
|
||||
|
||||
/*
|
||||
==================
|
||||
SV_Impulse_f
|
||||
|
@ -2654,7 +2656,7 @@ void SV_Impulse_f (void)
|
|||
|
||||
pr_global_struct->time = sv.time;
|
||||
|
||||
memset (&svs.clients[i].edict->v, 0, pr_edict_size-svprogparms.edictsize);
|
||||
SetUpClientEdict(&svs.clients[i], svs.clients[i].edict);
|
||||
|
||||
svs.clients[i].edict->v.netname = PR_SetString(svprogfuncs, "Console");
|
||||
|
||||
|
@ -2665,18 +2667,19 @@ void SV_Impulse_f (void)
|
|||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PutClientInServer);
|
||||
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPreThink);
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, svs.clients[i].edict->v.think);
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPostThink);
|
||||
|
||||
svs.clients[i].edict->v.impulse = atoi(Cmd_Argv(1));
|
||||
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPreThink);
|
||||
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, svs.clients[i].edict->v.think);
|
||||
{
|
||||
char buffer[256] = "self.ishuman";
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
Con_Printf("Result: %s\n", svprogfuncs->EvaluateDebugString(svprogfuncs, buffer));
|
||||
}
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPostThink);
|
||||
|
||||
|
@ -2848,6 +2851,7 @@ void SV_InitLocal (void)
|
|||
extern cvar_t pm_ktjump;
|
||||
extern cvar_t pm_slidefix;
|
||||
extern cvar_t pm_airstep;
|
||||
extern cvar_t pm_walljump;
|
||||
|
||||
SV_InitOperatorCommands ();
|
||||
SV_UserInit ();
|
||||
|
@ -2911,6 +2915,7 @@ void SV_InitLocal (void)
|
|||
Cvar_Register (&pm_ktjump, cvargroup_serverphysics);
|
||||
Cvar_Register (&pm_slidefix, cvargroup_serverphysics);
|
||||
Cvar_Register (&pm_airstep, cvargroup_serverphysics);
|
||||
Cvar_Register (&pm_walljump, cvargroup_serverphysics);
|
||||
|
||||
Cvar_Register (&sv_compatablehulls, cvargroup_serverphysics);
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ cvar_t pm_ktjump = {"pm_ktjump", "", NULL, CVAR_SERVERINFO};
|
|||
cvar_t pm_bunnyspeedcap = {"pm_bunnyspeedcap", "", NULL, CVAR_SERVERINFO};
|
||||
cvar_t pm_slidefix = {"pm_slidefix", "", NULL, CVAR_SERVERINFO};
|
||||
cvar_t pm_airstep = {"pm_airstep", "", NULL, CVAR_SERVERINFO};
|
||||
cvar_t pm_walljump = {"pm_walljump", "", NULL, CVAR_SERVERINFO};
|
||||
|
||||
extern cvar_t sv_nomsec;
|
||||
|
||||
|
@ -405,7 +406,7 @@ SV_AddGravity
|
|||
*/
|
||||
void SV_AddGravity (edict_t *ent, float scale)
|
||||
{
|
||||
ent->v.velocity[2] -= scale * movevars.gravity * host_frametime;
|
||||
ent->v.velocity[2] -= scale * sv_gravity.value/*movevars.gravity*/ * host_frametime;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -68,6 +68,7 @@ extern cvar_t pm_bunnyspeedcap;
|
|||
extern cvar_t pm_ktjump;
|
||||
extern cvar_t pm_slidefix;
|
||||
extern cvar_t pm_airstep;
|
||||
extern cvar_t pm_walljump;
|
||||
|
||||
char sv_votinggroup[] = "server voting";
|
||||
|
||||
|
@ -1011,7 +1012,7 @@ void SV_PreSpawn_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
static void SetUpClientEdict (client_t *cl, edict_t *ent);
|
||||
void SetUpClientEdict (client_t *cl, edict_t *ent);
|
||||
/*
|
||||
==================
|
||||
SV_Spawn_f
|
||||
|
@ -2491,7 +2492,7 @@ void Cmd_SetPos_f(void)
|
|||
}
|
||||
|
||||
void ED_ClearEdict (progfuncs_t *progfuncs, edict_t *e);
|
||||
static void SetUpClientEdict (client_t *cl, edict_t *ent)
|
||||
void SetUpClientEdict (client_t *cl, edict_t *ent)
|
||||
{
|
||||
extern int pr_teamfield;
|
||||
ED_ClearEdict(svprogfuncs, ent);
|
||||
|
@ -2528,23 +2529,27 @@ void Cmd_Join_f (void)
|
|||
if (!host_client->spectator)
|
||||
return; // already a player
|
||||
|
||||
if (!(host_client->zquake_extensions & Z_EXT_JOIN_OBSERVE)) {
|
||||
if (!(host_client->zquake_extensions & Z_EXT_JOIN_OBSERVE))
|
||||
{
|
||||
Con_Printf ("Your QW client doesn't support this command\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (password.string[0] && stricmp(password.string, "none")) {
|
||||
if (password.string[0] && stricmp(password.string, "none"))
|
||||
{
|
||||
Con_Printf ("This server requires a %s password. Please disconnect, set the password and reconnect as %s.\n", "player", "player");
|
||||
return;
|
||||
}
|
||||
|
||||
// count players already on server
|
||||
numclients = 0;
|
||||
for (i=0,cl=svs.clients ; i<sv.allocated_client_slots ; i++,cl++) {
|
||||
for (i=0,cl=svs.clients ; i<sv.allocated_client_slots ; i++,cl++)
|
||||
{
|
||||
if (cl->state != cs_free && !cl->spectator)
|
||||
numclients++;
|
||||
}
|
||||
if (numclients >= maxclients.value) {
|
||||
if (numclients >= maxclients.value)
|
||||
{
|
||||
Con_Printf ("Can't join, all player slots full\n");
|
||||
return;
|
||||
}
|
||||
|
@ -3772,6 +3777,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
|
|||
movevars.ktjump = pm_ktjump.value;
|
||||
movevars.slidefix = (pm_slidefix.value != 0);
|
||||
movevars.airstep = (pm_airstep.value != 0);
|
||||
movevars.walljump = (pm_walljump.value != 0);
|
||||
|
||||
if (sv_player->v.hasted)
|
||||
movevars.maxspeed*=sv_player->v.hasted;
|
||||
|
|
Loading…
Reference in a new issue