SV_SHOOT reduction
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5391 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -592,10 +592,10 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
|
||||
{
|
||||
int scn = getint(p), gun = getint(p);
|
||||
vec from, to;
|
||||
loopk(3) from[k] = getint(p)/DMF;
|
||||
loopk(3) to[k] = getint(p)/DMF;
|
||||
playerent *s = getclient(scn);
|
||||
if(!s || !weapon::valid(gun)) break;
|
||||
loopk(3) from[k] = s->o.v[k] + ( k == 2 ? (s->crouching?2.2f:4.2f) : 0);
|
||||
if(gun==GUN_SHOTGUN) createrays(from, to);
|
||||
s->lastaction = lastmillis;
|
||||
s->mag[gun]--;
|
||||
|
||||
@@ -321,7 +321,7 @@ static const int msgsizes[] = // size inclusive message token, 0 f
|
||||
SV_SERVINFO, 5, SV_WELCOME, 2, SV_INITCLIENT, 0, SV_POS, 0, SV_POSC, 0, SV_POSN, 0, SV_TEXT, 0, SV_TEAMTEXT, 0, SV_TEXTME, 0, SV_TEAMTEXTME, 0,
|
||||
SV_SOUND, 2, SV_VOICECOM, 2, SV_VOICECOMTEAM, 2, SV_CDIS, 2,
|
||||
SV_SHOOT, 0, SV_EXPLODE, 0, SV_SUICIDE, 1, SV_AKIMBO, 2, SV_RELOAD, 3, SV_SCOPE, 3,
|
||||
SV_GIBDIED, 5, SV_DIED, 5, SV_GIBDAMAGE, 6, SV_DAMAGE, 6, SV_HITPUSH, 6, SV_SHOTFX, 9, SV_THROWNADE, 8,
|
||||
SV_GIBDIED, 5, SV_DIED, 5, SV_GIBDAMAGE, 6, SV_DAMAGE, 6, SV_HITPUSH, 6, SV_SHOTFX, 6, SV_THROWNADE, 8,
|
||||
SV_TRYSPAWN, 1, SV_SPAWNSTATE, 23, SV_SPAWN, 3, SV_SPAWNDENY, 2, SV_FORCEDEATH, 2, SV_RESUME, 0,
|
||||
SV_DISCSCORES, 0, SV_TIMEUP, 2, SV_EDITENT, 10, SV_ITEMACC, 2,
|
||||
SV_MAPCHANGE, 0, SV_ITEMSPAWN, 2, SV_ITEMPICKUP, 2,
|
||||
|
||||
@@ -2854,7 +2854,7 @@ void process(ENetPacket *packet, int sender, int chan)
|
||||
seteventmillis(shot.shot);
|
||||
shot.shot.gun = getint(p);
|
||||
// loopk(3) shot.shot.from[k] = getint(p)/DMF;
|
||||
loopk(3) { shot.shot.from[k] = cl->state.o.v[k] + ( k == 2 ? (((cl->f>>7)&1)?2.2f:4.2f) : 0); getint(p);}
|
||||
loopk(3) { shot.shot.from[k] = cl->state.o.v[k] + ( k == 2 ? (((cl->f>>7)&1)?2.2f:4.2f) : 0); /*getint(p);*/}
|
||||
loopk(3) shot.shot.to[k] = getint(p)/DMF;
|
||||
checkshoot(sender, &shot);
|
||||
int hits = getint(p);
|
||||
|
||||
@@ -42,8 +42,8 @@ void processevent(client *c, shotevent &e)
|
||||
gs.lastshot = e.millis;
|
||||
gs.gunwait[e.gun] = attackdelay(e.gun);
|
||||
if(e.gun==GUN_PISTOL && gs.akimbomillis>gamemillis) gs.gunwait[e.gun] /= 2;
|
||||
sendf(-1, 1, "ri9x", SV_SHOTFX, c->clientnum, e.gun,
|
||||
int(e.from[0]*DMF), int(e.from[1]*DMF), int(e.from[2]*DMF),
|
||||
sendf(-1, 1, "ri6x", SV_SHOTFX, c->clientnum, e.gun,
|
||||
// int(e.from[0]*DMF), int(e.from[1]*DMF), int(e.from[2]*DMF),
|
||||
int(e.to[0]*DMF), int(e.to[1]*DMF), int(e.to[2]*DMF),
|
||||
c->clientnum);
|
||||
gs.shotdamage += guns[e.gun].damage*(e.gun==GUN_SHOTGUN ? SGRAYS : 1);
|
||||
|
||||
@@ -575,8 +575,8 @@ int weapon::flashtime() const { return max((int)info.attackdelay, 120)/4; }
|
||||
void weapon::sendshoot(vec &from, vec &to)
|
||||
{
|
||||
if(owner!=player1) return;
|
||||
addmsg(SV_SHOOT, "ri2i6iv", lastmillis, owner->weaponsel->type,
|
||||
(int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF),
|
||||
addmsg(SV_SHOOT, "ri2i3iv", lastmillis, owner->weaponsel->type,
|
||||
// (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF),
|
||||
(int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF),
|
||||
hits.length(), hits.length()*sizeof(hitmsg)/sizeof(int), hits.getbuf());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user