From e34e203dfd12f9db823d3904f905b37fbc58c2af Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Mon, 16 Aug 2010 03:09:30 +0000 Subject: [PATCH] clean up and trying to identify why sometimes after a spawn, it is not possible to get some items git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5633 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entities.cpp | 28 ++++++++++++++-------------- source/src/entity.h | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index cbd1b256..c61b9d4b 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -102,19 +102,19 @@ COMMAND(setedithide, ARG_CONC); void seteditshow(char *just) { eh_ents.setsize(0); - if(just && just[0] != '\0') - { - const char *s = strtok(just, " "); - int sn = -1; - int tn = atoi(s); - loopi(MAXENTTYPES) if(!strcmp(entnames[i], s)) sn = i; - if(sn==-1) sn = tn; - loopi(MAXENTTYPES-1) - { - int j = i+1; - if(j!=sn) eh_ents.add(j); - } - } + if(just && just[0] != '\0') + { + const char *s = strtok(just, " "); + int sn = -1; + int tn = atoi(s); + loopi(MAXENTTYPES) if(!strcmp(entnames[i], s)) sn = i; + if(sn==-1) sn = tn; + loopi(MAXENTTYPES-1) + { + int j = i+1; + if(j!=sn) eh_ents.add(j); + } + } } COMMAND(seteditshow, ARG_1STR); @@ -241,7 +241,7 @@ void trypickup(int n, playerent *d) switch(e.type) { default: - if( d->canpickup(e.type) && lastmillis > e.lastmillis + 100 && lastmillis > lastspawn + 500 ) + if( d->canpickup(e.type) && lastmillis > e.lastmillis + 250 && lastmillis > lastspawn + 500 ) { if(d->type==ENT_PLAYER) addmsg(SV_ITEMPICKUP, "ri", n); else if(d->type==ENT_BOT && serverpickup(n, -1)) pickupeffects(n, d); diff --git a/source/src/entity.h b/source/src/entity.h index 5c78b9f1..e33d6532 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -229,7 +229,7 @@ public: bool akimbo; int ammo[NUMGUNS], mag[NUMGUNS], gunwait[NUMGUNS]; - playerstate() : primary(GUN_ASSAULT), nextprimary(GUN_ASSAULT) {} + playerstate() : armour(0), primary(GUN_ASSAULT), nextprimary(GUN_ASSAULT), akimbo(false) {} virtual ~playerstate() {} itemstat &itemstats(int type)