mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 06:42:26 +00:00
Add "overloaded" impulse command (e.g. impulse 5 4 1) --- a hack that
only works correctly in standard deathmatch but may be useful in TF too
This commit is contained in:
parent
9fcea8629e
commit
d46f19e7ae
3 changed files with 69 additions and 1 deletions
|
@ -31,4 +31,6 @@
|
|||
extern cvar_t *cl_deadbodyfilter;
|
||||
extern cvar_t *cl_gibfilter;
|
||||
|
||||
// FIXME: prefix these with TP_ or Team_ ?
|
||||
void CL_InitTeamplay (void);
|
||||
void CL_BestWeaponImpulse (void);
|
||||
|
|
|
@ -181,7 +181,14 @@ void IN_UseUp (void) {KeyUp(&in_use);}
|
|||
void IN_JumpDown (void) {KeyDown(&in_jump);}
|
||||
void IN_JumpUp (void) {KeyUp(&in_jump);}
|
||||
|
||||
void IN_Impulse (void) {in_impulse=atoi(Cmd_Argv(1));}
|
||||
void IN_Impulse (void)
|
||||
{
|
||||
in_impulse= atoi(Cmd_Argv(1));
|
||||
if (Cmd_Argc() <= 2)
|
||||
return;
|
||||
|
||||
CL_BestWeaponImpulse(); // HACK HACK HACK
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#include "bothdefs.h"
|
||||
#include "client.h"
|
||||
#include "cmd.h"
|
||||
#include "cvar.h"
|
||||
#include "teamplay.h"
|
||||
|
||||
|
@ -33,6 +36,62 @@ cvar_t *cl_deadbodyfilter;
|
|||
cvar_t *cl_gibfilter;
|
||||
|
||||
|
||||
void CL_BestWeaponImpulse (void)
|
||||
{
|
||||
int best, i, imp, items;
|
||||
extern int in_impulse;
|
||||
|
||||
items = cl.stats[STAT_ITEMS];
|
||||
best = 0;
|
||||
|
||||
for (i = Cmd_Argc() - 1; i > 0; i--)
|
||||
{
|
||||
imp = atoi(Cmd_Argv(i));
|
||||
if (imp < 1 || imp > 8)
|
||||
continue;
|
||||
|
||||
switch (imp)
|
||||
{
|
||||
case 1:
|
||||
if (items & IT_AXE)
|
||||
best = 1;
|
||||
break;
|
||||
case 2:
|
||||
if (items & IT_SHOTGUN && cl.stats[STAT_SHELLS] >= 1)
|
||||
best = 2;
|
||||
break;
|
||||
case 3:
|
||||
if (items & IT_SUPER_SHOTGUN && cl.stats[STAT_SHELLS] >= 2)
|
||||
best = 3;
|
||||
break;
|
||||
case 4:
|
||||
if (items & IT_NAILGUN && cl.stats[STAT_NAILS] >= 1)
|
||||
best = 4;
|
||||
break;
|
||||
case 5:
|
||||
if (items & IT_SUPER_NAILGUN && cl.stats[STAT_NAILS] >= 2)
|
||||
best = 5;
|
||||
break;
|
||||
case 6:
|
||||
if (items & IT_GRENADE_LAUNCHER && cl.stats[STAT_ROCKETS] >= 1)
|
||||
best = 6;
|
||||
break;
|
||||
case 7:
|
||||
if (items & IT_ROCKET_LAUNCHER && cl.stats[STAT_ROCKETS] >= 1)
|
||||
best = 7;
|
||||
break;
|
||||
case 8:
|
||||
if (items & IT_LIGHTNING && cl.stats[STAT_CELLS] >= 1)
|
||||
best = 8;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (best)
|
||||
in_impulse = best;
|
||||
}
|
||||
|
||||
|
||||
void CL_InitTeamplay (void)
|
||||
{
|
||||
cl_deadbodyfilter = Cvar_Get("cl_deadbodyfilter", "0", CVAR_NONE, "None");
|
||||
|
|
Loading…
Reference in a new issue