comment, flag fix (related to cover) and reliable lag information
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5434 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -357,7 +357,7 @@ void c2sinfo(playerent *d) // send update to the server
|
||||
dz = dzt - d->vel_t.i[2],
|
||||
// pack rest in 1 int: strafe:2, move:2, onfloor:1, onladder: 1
|
||||
f = (d->strafe&3) | ((d->move&3)<<2) | (((int)d->onfloor)<<4) | (((int)d->onladder)<<5) | ((d->lifesequence&1)<<6) | (((int)d->crouching)<<7),
|
||||
g = (dx?1:0) | ((dy?1:0)<<1) | ((dz?1:0)<<2) | ((r?1:0)<<3) | (((int)d->scoping)<<4) | (((int)d->shoot)<<5);
|
||||
g = (dx?1:0) | ((dy?1:0)<<1) | ((dz?1:0)<<2) | ((r?1:0)<<3) | (((int)d->scoping)<<4) | (((int)d->shoot)<<5); // FIXME please remove this d->shoot in the protocol update
|
||||
d->vel_t.i[0] = dxt;
|
||||
d->vel_t.i[1] = dyt;
|
||||
d->vel_t.i[2] = dzt;
|
||||
@@ -401,7 +401,7 @@ void c2sinfo(playerent *d) // send update to the server
|
||||
b.putbits(1, s == 11 ? 1 : 0);
|
||||
b.putbits(s, z);
|
||||
b.putbits(1, d->scoping ? 1 : 0);
|
||||
b.putbits(1, d->shoot ? 1 : 0);
|
||||
b.putbits(1, d->shoot ? 1 : 0); // FIXME please remove this d->shoot in the protocol update
|
||||
}
|
||||
else
|
||||
{ // classic POS packet
|
||||
|
||||
@@ -679,6 +679,8 @@ struct sflaginfo
|
||||
int lastupdate;
|
||||
int stolentime;
|
||||
short x, y; // flag entity location
|
||||
|
||||
sflaginfo() { actor_cn = -1; }
|
||||
} sflaginfos[2];
|
||||
|
||||
void putflaginfo(packetbuf &p, int flag)
|
||||
|
||||
+20
-16
@@ -1,7 +1,7 @@
|
||||
|
||||
inline bool is_lagging(client *cl)
|
||||
{
|
||||
return ( cl->spj > 80 || cl->ping > 1000 || gamemillis - cl->lmillis > 400 );
|
||||
return ( cl->spj > 55 || cl->ping > 500 || cl->ldt > 80 ); // do not change this except if you really know what are you doing
|
||||
}
|
||||
|
||||
inline float pow2(float x)
|
||||
@@ -377,16 +377,19 @@ void checkcover (client *target, client *actor)
|
||||
testcover(HE_FLAGCOVERED, CTFLCOVPT, actor);
|
||||
}
|
||||
} else if ( m_htf ) {
|
||||
if ( f.state == CTFF_DROPPED ) {
|
||||
struct { short x, y; } nf;
|
||||
nf.x = f.pos[0]; nf.y = f.pos[1];
|
||||
CALCCOVER(nf);
|
||||
testcover(HE_FLAGDEFENDED, HTFLDEFPT, actor);
|
||||
}
|
||||
if ( f.state == CTFF_STOLEN && actor->clientnum != f.actor_cn ) {
|
||||
covered = true; coverid = f.actor_cn;
|
||||
CALCCOVER(clients[f.actor_cn]->state.o);
|
||||
testcover(HE_FLAGCOVERED, HTFLCOVPT, actor);
|
||||
if ( actor->clientnum != f.actor_cn )
|
||||
{
|
||||
if ( f.state == CTFF_DROPPED ) {
|
||||
struct { short x, y; } nf;
|
||||
nf.x = f.pos[0]; nf.y = f.pos[1];
|
||||
CALCCOVER(nf);
|
||||
testcover(HE_FLAGDEFENDED, HTFLDEFPT, actor);
|
||||
}
|
||||
if ( f.state == CTFF_STOLEN ) {
|
||||
covered = true; coverid = f.actor_cn;
|
||||
CALCCOVER(clients[f.actor_cn]->state.o);
|
||||
testcover(HE_FLAGCOVERED, HTFLCOVPT, actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -506,7 +509,7 @@ inline void checkmove (client *cl)
|
||||
{
|
||||
cl->ldt = gamemillis - cl->lmillis;
|
||||
cl->lmillis = gamemillis;
|
||||
if ( cl->ldt < 30 ) cl->ldt = 30;
|
||||
if ( cl->ldt < 40 ) cl->ldt = 40;
|
||||
cl->t += cl->ldt;
|
||||
cl->spj = (( 7 * cl->spj + cl->ldt ) >> 3);
|
||||
|
||||
@@ -515,14 +518,15 @@ inline void checkmove (client *cl)
|
||||
cl->inputmillis = servmillis;
|
||||
}
|
||||
|
||||
#ifdef ACAC
|
||||
m_engine(cl);
|
||||
#endif
|
||||
|
||||
if ( !cl->upspawnp ) {
|
||||
cl->spawnp = cl->state.o;
|
||||
cl->upspawnp = true;
|
||||
}
|
||||
|
||||
#ifdef ACAC
|
||||
m_engine(cl);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -535,7 +539,7 @@ inline void checkshoot (int cn, gameevent *shot)
|
||||
return;
|
||||
}
|
||||
|
||||
bool validdamage (client *target, client *actor, int gun, bool gib)
|
||||
bool validdamage (client *&target, client *&actor, int &gun, bool &gib)
|
||||
{
|
||||
|
||||
#ifdef ACAC
|
||||
|
||||
Reference in New Issue
Block a user