- un-inline stuff that really doesn't need to be
- unify weapon id checks
- shrink guns
This commit is contained in:
ac-stef
2017-05-02 21:38:58 +02:00
parent 777638f3a9
commit 5e638565f8
11 changed files with 85 additions and 113 deletions
+3 -3
View File
@@ -3105,7 +3105,7 @@ void process(ENetPacket *packet, int sender, int chan)
case SV_WEAPCHANGE:
{
int gunselect = getint(p);
if(gunselect<0 || gunselect>=NUMGUNS || gunselect == GUN_CPISTOL) break;
if(!valid_weapon(gunselect) || gunselect == GUN_CPISTOL) break;
if(!m_demo && !m_coop) checkweapon(type,gunselect);
cl->state.gunselect = gunselect;
QUEUE_MSG;
@@ -3115,7 +3115,7 @@ void process(ENetPacket *packet, int sender, int chan)
case SV_PRIMARYWEAP:
{
int nextprimary = getint(p);
if (nextprimary < 0 || nextprimary >= NUMGUNS) break;
if(!valid_weapon(nextprimary)) break;
cl->state.nextprimary = nextprimary;
break;
}
@@ -3204,7 +3204,7 @@ void process(ENetPacket *packet, int sender, int chan)
{
int ls = getint(p), gunselect = getint(p);
if((cl->state.state!=CS_ALIVE && cl->state.state!=CS_DEAD && cl->state.state!=CS_SPECTATE) ||
ls!=cl->state.lifesequence || cl->state.lastspawn<0 || gunselect<0 || gunselect>=NUMGUNS || gunselect == GUN_CPISTOL) break;
ls!=cl->state.lifesequence || cl->state.lastspawn<0 || !valid_weapon(gunselect) || gunselect == GUN_CPISTOL) break;
cl->state.lastspawn = -1;
cl->state.spawn = gamemillis;
cl->autospawn = false;